mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-20 09:40:49 +01:00
Compare commits
3 Commits
20f1003ce6
...
468e662e4f
Author | SHA1 | Date | |
---|---|---|---|
468e662e4f | |||
3ba6d2d24f | |||
d9e6c30567 |
@ -2079,7 +2079,7 @@ void GUI::updateRecentFiles(const QString &fileName)
|
|||||||
|
|
||||||
QList<QAction *> actions(_recentFilesActionGroup->actions());
|
QList<QAction *> actions(_recentFilesActionGroup->actions());
|
||||||
for (int i = 0; i < actions.size(); i++) {
|
for (int i = 0; i < actions.size(); i++) {
|
||||||
if (actions.at(i)->text() == fileName) {
|
if (actions.at(i)->data().toString() == fileName) {
|
||||||
a = actions.at(i);
|
a = actions.at(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2092,8 +2092,9 @@ void GUI::updateRecentFiles(const QString &fileName)
|
|||||||
|
|
||||||
actions = _recentFilesActionGroup->actions();
|
actions = _recentFilesActionGroup->actions();
|
||||||
QAction *before = actions.size() ? actions.last() : _recentFilesEnd;
|
QAction *before = actions.size() ? actions.last() : _recentFilesEnd;
|
||||||
_recentFilesMenu->insertAction(before,
|
a = new QAction(fileName, _recentFilesActionGroup);
|
||||||
new QAction(fileName, _recentFilesActionGroup));
|
a->setData(fileName);
|
||||||
|
_recentFilesMenu->insertAction(before, a);
|
||||||
_recentFilesMenu->setEnabled(true);
|
_recentFilesMenu->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2110,7 +2111,7 @@ void GUI::clearRecentFiles()
|
|||||||
void GUI::recentFileSelected(QAction *action)
|
void GUI::recentFileSelected(QAction *action)
|
||||||
{
|
{
|
||||||
int showError = 1;
|
int showError = 1;
|
||||||
openFile(action->text(), true, showError);
|
openFile(action->data().toString(), true, showError);
|
||||||
}
|
}
|
||||||
#endif // Q_OS_ANDROID
|
#endif // Q_OS_ANDROID
|
||||||
|
|
||||||
@ -2488,7 +2489,7 @@ void GUI::writeSettings()
|
|||||||
QList<QAction*> recentActions(_recentFilesActionGroup->actions());
|
QList<QAction*> recentActions(_recentFilesActionGroup->actions());
|
||||||
QStringList recent;
|
QStringList recent;
|
||||||
for (int i = 0; i < recentActions.size(); i++)
|
for (int i = 0; i < recentActions.size(); i++)
|
||||||
recent.append(recentActions.at(i)->text());
|
recent.append(recentActions.at(i)->data().toString());
|
||||||
|
|
||||||
settings.beginGroup(SETTINGS_FILE);
|
settings.beginGroup(SETTINGS_FILE);
|
||||||
WRITE(recentDataFiles, recent);
|
WRITE(recentDataFiles, recent);
|
||||||
@ -3229,6 +3230,7 @@ void GUI::loadRecentFiles(const QStringList &files)
|
|||||||
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
for (int i = 0; i < files.size(); i++) {
|
||||||
QAction *a = new QAction(files.at(i), _recentFilesActionGroup);
|
QAction *a = new QAction(files.at(i), _recentFilesActionGroup);
|
||||||
|
a->setData(files.at(i));
|
||||||
_recentFilesMenu->insertAction(before, a);
|
_recentFilesMenu->insertAction(before, a);
|
||||||
before = a;
|
before = a;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user