File tree 1 file changed +20
-2
lines changed 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -245,14 +245,32 @@ bool parseConfigFileDirectory(Config *config, const QString &dirName)
245
245
246
246
static bool removeDefault ()
247
247
{
248
- if (QFile::exists (B2QT_PREFIX)) {
248
+ QFileInfo fi (B2QT_PREFIX);
249
+
250
+ if (fi.isSymLink ()) {
249
251
if (!QFile::remove (B2QT_PREFIX)) {
250
252
fprintf (stderr, " Could not remove default application.\n " );
251
253
return false ;
252
254
}
253
255
sync ();
256
+ return true ;
254
257
}
255
- return true ;
258
+
259
+ if (fi.isDir ()) {
260
+ fprintf (stderr, " Could not remove default application because '" B2QT_PREFIX " ' is a directory. It should be a symlink.\n " );
261
+ return false ;
262
+ }
263
+
264
+ if (fi.isFile ()) {
265
+ fprintf (stderr, " Could not remove default application because '" B2QT_PREFIX " ' is a file. It should be a symlink.\n " );
266
+ return false ;
267
+ }
268
+
269
+ if (!fi.exists ()) {
270
+ return true ;
271
+ }
272
+
273
+ return false ;
256
274
}
257
275
258
276
static bool makeDefault (const QString &filepath)
You can’t perform that action at this time.
0 commit comments