r20212 by craig - Better code related to file open recent from toolbar related to #13176/11351. but problem not fixed

scribus-commit scribus-commit at lists.scribus.net
Fri Jun 26 21:41:54 UTC 2015


Author: craig
Date: Fri Jun 26 21:41:53 2015
New Revision: 20212

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20212
Log:
Better code related to file open recent from toolbar related to #13176/11351. but problem not fixed

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/filetoolbar.cpp
    trunk/Scribus/scribus/ui/filetoolbar.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20212&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Jun 26 21:41:53 2015
@@ -2909,6 +2909,7 @@
 
 void ScribusMainWindow::loadRecent(QString filename)
 {
+	qDebug()<<filename;
 	QFileInfo fd(filename);
 	if (!fd.exists())
 	{

Modified: trunk/Scribus/scribus/ui/filetoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20212&path=/trunk/Scribus/scribus/ui/filetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/filetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/filetoolbar.cpp Fri Jun 26 21:41:53 2015
@@ -39,16 +39,16 @@
 	addAction(p->scrActions["filePrint"]);
 	addAction(p->scrActions["toolsPreflightVerifier"]);
 	addAction(p->scrActions["fileExportAsPDF"]);
+	fileOpenButtonMenu = new QMenu();
+	QToolButton* tb = dynamic_cast<QToolButton*>(widgetForAction(parent->scrActions["fileOpen"]));
+	tb->setMenu(fileOpenButtonMenu);
+	tb->setPopupMode(QToolButton::DelayedPopup);
 }
 
 void FileToolBar::rebuildRecentFileMenu()
 {
-	QToolButton* tb = dynamic_cast<QToolButton*>(widgetForAction(parent->scrActions["fileOpen"]));
-	QMenu *m=new QMenu(this);
+	fileOpenButtonMenu->clear();
 	ScrAction *recentFileAction;
 	foreach (recentFileAction, parent->scrRecentFileActions)
-		m->addAction(recentFileAction);
-	tb->setMenu(m);
-//	tb->setPopupMode(QToolButton::MenuButtonPopup);
-	tb->setPopupMode(QToolButton::DelayedPopup);
+		fileOpenButtonMenu->addAction(recentFileAction);
 }

Modified: trunk/Scribus/scribus/ui/filetoolbar.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20212&path=/trunk/Scribus/scribus/ui/filetoolbar.h
==============================================================================
--- trunk/Scribus/scribus/ui/filetoolbar.h (original)
+++ trunk/Scribus/scribus/ui/filetoolbar.h Fri Jun 26 21:41:53 2015
@@ -43,6 +43,7 @@
 
 	protected:
 		ScribusMainWindow* parent;
+		QMenu* fileOpenButtonMenu;
 };
 
 #endif




More information about the scribus-commit mailing list