Skip to content

Commit 7462b33

Browse files
committed
fixed crash when trying to sort data files on Linux
1 parent f22a0f5 commit 7462b33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/MainWindow.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ class MainWindow : public QMainWindow, private DialogWithPaths {
415415
ConfigFile( const QString & fileName ) : fileName( fileName ) {}
416416
ConfigFile( const QFileInfo & file ) : fileName( file.fileName() ) {}
417417
QString getID() const { return fileName; }
418+
const QString & getFilePath() const { return fileName; } // it's not a path, but it's only used for sorting, so it's ok
418419
};
419420
ReadOnlyDirectListModel< ConfigFile > configModel; ///< list of config files found in pre-defined directory
420421

@@ -424,6 +425,7 @@ class MainWindow : public QMainWindow, private DialogWithPaths {
424425
SaveFile( const QString & fileName ) : fileName( fileName ) {}
425426
SaveFile( const QFileInfo & file ) : fileName( file.fileName() ) {}
426427
QString getID() const { return fileName; }
428+
const QString & getFilePath() const { return fileName; } // it's not a path, but it's only used for sorting, so it's ok
427429
};
428430
ReadOnlyDirectListModel< SaveFile > saveModel; ///< list of save files found in pre-defined directory
429431

@@ -433,6 +435,7 @@ class MainWindow : public QMainWindow, private DialogWithPaths {
433435
DemoFile( const QString & fileName ) : fileName( fileName ) {}
434436
DemoFile( const QFileInfo & file ) : fileName( file.fileName() ) {}
435437
QString getID() const { return fileName; }
438+
const QString & getFilePath() const { return fileName; } // it's not a path, but it's only used for sorting, so it's ok
436439
};
437440
ReadOnlyDirectListModel< DemoFile > demoModel; ///< list of demo files found in pre-defined directory
438441

0 commit comments

Comments
 (0)