comparison src/MainWindow.cpp @ 188:b970b39e1fab

Do not put layer files in Recent Files list (related to #881)
author Chris Cannam
date Tue, 04 Mar 2014 15:28:59 +0000
parents dedd09297a3e
children e963bdbc0707
comparison
equal deleted inserted replaced
187:dedd09297a3e 188:b970b39e1fab
1280 { 1280 {
1281 QObject *obj = sender(); 1281 QObject *obj = sender();
1282 QAction *action = qobject_cast<QAction *>(obj); 1282 QAction *action = qobject_cast<QAction *>(obj);
1283 1283
1284 if (!action) { 1284 if (!action) {
1285 cerr << "WARNING: MainWindow::openRecentFile: sender is not an action" 1285 cerr << "WARNING: MainWindow::openRecentFile: sender is not an action"
1286 << endl; 1286 << endl;
1287 return; 1287 return;
1288 } 1288 }
1289 1289
1290 QString path = action->text(); 1290 QString path = action->text();
1291 if (path == "") return; 1291 if (path == "") return;
1292 1292
1608 1608
1609 CommandHistory::getInstance()->endCompoundOperation(); 1609 CommandHistory::getInstance()->endCompoundOperation();
1610 1610
1611 //!!! swap all data in to existing layer instead of this 1611 //!!! swap all data in to existing layer instead of this
1612 1612
1613 m_recentFiles.addFile(source.getLocation());
1614
1615 if (!source.isRemote()) { 1613 if (!source.isRemote()) {
1616 registerLastOpenedFilePath 1614 registerLastOpenedFilePath
1617 (FileFinder::LayerFile, 1615 (FileFinder::LayerFile,
1618 path); // for file dialog 1616 path); // for file dialog
1619 } 1617 }
1676 } 1674 }
1677 1675
1678 if (error != "") { 1676 if (error != "") {
1679 QMessageBox::critical(this, tr("Failed to write file"), error); 1677 QMessageBox::critical(this, tr("Failed to write file"), error);
1680 } else { 1678 } else {
1681 m_recentFiles.addFile(path);
1682 emit activity(tr("Export layer to \"%1\"").arg(path)); 1679 emit activity(tr("Export layer to \"%1\"").arg(path));
1683 } 1680 }
1684 } 1681 }
1685 1682
1686 void 1683 void
1736 } 1733 }
1737 1734
1738 if (error != "") { 1735 if (error != "") {
1739 QMessageBox::critical(this, tr("Failed to write file"), error); 1736 QMessageBox::critical(this, tr("Failed to write file"), error);
1740 } else { 1737 } else {
1741 m_recentFiles.addFile(path);
1742 emit activity(tr("Export layer to \"%1\"").arg(path)); 1738 emit activity(tr("Export layer to \"%1\"").arg(path));
1743 } 1739 }
1744 } 1740 }
1745 1741
1746 void 1742 void