r16666 by jghali - #8252: cannot open a file through double click in OSX Finder

scribus-commit scribus-commit at lists.scribus.net
Wed Jun 15 22:17:36 UTC 2011


Author: jghali
Date: Wed Jun 15 22:17:35 2011
New Revision: 16666

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16666
Log:
#8252: cannot open a file through double click in OSX Finder

Modified:
    branches/Version135/Scribus/scribus/scribusapp.cpp
    branches/Version135/Scribus/scribus/scribusapp.h

Modified: branches/Version135/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16666&path=/branches/Version135/Scribus/scribus/scribusapp.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusapp.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusapp.cpp Wed Jun 15 22:17:35 2011
@@ -501,3 +501,26 @@
 {
 	return QFileInfo(ScPaths::getApplicationDataDir() + ".neversplash").exists();
 }
+
+bool ScribusQApp::event(QEvent *event)
+{
+	switch (event->type()) 
+	{
+	case QEvent::FileOpen:
+		{
+			QString filename = static_cast<QFileOpenEvent*>(event)->file();
+			if(m_ScCore && m_ScCore->initialized())
+			{
+				ScribusMainWindow* mw = m_ScCore->primaryMainWindow();
+				mw->loadDoc(filename);
+			}
+			else
+			{
+				filesToLoad.append(filename);
+			}
+			return true;
+		}
+	default:
+		return QApplication::event(event);
+	}
+}

Modified: branches/Version135/Scribus/scribus/scribusapp.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16666&path=/branches/Version135/Scribus/scribus/scribusapp.h
==============================================================================
--- branches/Version135/Scribus/scribus/scribusapp.h (original)
+++ branches/Version135/Scribus/scribus/scribusapp.h Wed Jun 15 22:17:35 2011
@@ -95,6 +95,9 @@
 		QString prefsUserFile;
 		QList<QString> filesToLoad;
 		QString fileName;
+
+	protected:
+		virtual bool event(QEvent *event);
 };
 
 #endif




More information about the scribus-commit mailing list