r16667 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:18:36 UTC 2011
Author: jghali
Date: Wed Jun 15 22:18:36 2011
New Revision: 16667
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16667
Log:
#8252: cannot open a file through double click in OSX Finder
Modified:
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribusapp.h
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16667&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Wed Jun 15 22:18:36 2011
@@ -530,3 +530,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: trunk/Scribus/scribus/scribusapp.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16667&path=/trunk/Scribus/scribus/scribusapp.h
==============================================================================
--- trunk/Scribus/scribus/scribusapp.h (original)
+++ trunk/Scribus/scribus/scribusapp.h Wed Jun 15 22:18:36 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