improved recent file handling for macos.
This commit is contained in:
parent
7556a2e243
commit
a895903a58
@ -775,13 +775,13 @@ PAdmin::PAdmin() : QObject()
|
||||
|
||||
// XML Parser part
|
||||
// 1st: check local directory
|
||||
QString path = QString("./");
|
||||
QString path = QDir::currentPath();
|
||||
QString fln = QString("musredit_startup.xml");
|
||||
QString pathFln = path + fln;
|
||||
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
|
||||
if (!QFile::exists(pathFln)) {
|
||||
// 2nd: check $HOME/.musrfit/musredit/musredit_startup.xml
|
||||
path = procEnv.value("HOME", "");
|
||||
path = QDir::homePath();
|
||||
pathFln = path + "/.musrfit/musredit/" + fln;
|
||||
if (!QFile::exists(pathFln)) {
|
||||
// 3rd: check $MUSRFITPATH/musredit_startup.xml
|
||||
@ -833,15 +833,6 @@ PAdmin::PAdmin() : QObject()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Destructor
|
||||
*/
|
||||
PAdmin::~PAdmin()
|
||||
{
|
||||
saveRecentFiles();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>returns the help url corresponding the the tag.
|
||||
|
@ -65,7 +65,6 @@ class PAdminXMLParser
|
||||
{
|
||||
public:
|
||||
PAdminXMLParser(const QString &fln, PAdmin*);
|
||||
virtual ~PAdminXMLParser() {}
|
||||
|
||||
virtual bool isValid() { return fValid; }
|
||||
|
||||
@ -113,7 +112,6 @@ class PAdmin : public QObject
|
||||
{
|
||||
public:
|
||||
PAdmin();
|
||||
virtual ~PAdmin();
|
||||
|
||||
int getTimeout() { return fTimeout; }
|
||||
QString getFontName() { return fFontName; }
|
||||
@ -173,6 +171,7 @@ class PAdmin : public QObject
|
||||
|
||||
int loadPrefs(QString fln);
|
||||
int savePrefs(QString pref_fln);
|
||||
void saveRecentFiles(); ///< save recent file list
|
||||
|
||||
protected:
|
||||
void setExecPath(const QString str) { fExecPath = str; }
|
||||
@ -228,7 +227,6 @@ class PAdmin : public QObject
|
||||
|
||||
QVector<PTheory> fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit.
|
||||
|
||||
void saveRecentFiles(); ///< save recent file list
|
||||
void createMusreditStartupFile(); ///< create default musredit_startup.xml
|
||||
};
|
||||
|
||||
|
@ -1673,6 +1673,8 @@ void PTextEdit::fileExit()
|
||||
}
|
||||
}
|
||||
|
||||
fAdmin->saveRecentFiles();
|
||||
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user