From bd37f44bf3ce463038d131417bbc8d77ef38e9f7 Mon Sep 17 00:00:00 2001 From: Brett Weir Date: Sun, 24 Apr 2016 03:33:42 -0700 Subject: [PATCH] Revert "Add lots of stupid code and subclassing QApplication just to support file opening in PropellerIDE, because Mac." This reverts commit 526e2ffe16ce682ab8dfad09a22a41adb442a4ae. --- .gitignore | 2 -- src/propelleride/application.cpp | 30 ------------------------------ src/propelleride/application.h | 22 ---------------------- src/propelleride/main.cpp | 11 ----------- src/propelleride/mainwindow.cpp | 5 ----- src/propelleride/propelleride.pro | 7 +------ 6 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 src/propelleride/application.cpp delete mode 100644 src/propelleride/application.h diff --git a/.gitignore b/.gitignore index c1a3698..0a2e4b8 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,3 @@ Makefile* src/propelleride/propelleride src/terminal/propterm build/ - -.DS_Store diff --git a/src/propelleride/application.cpp b/src/propelleride/application.cpp deleted file mode 100644 index f667b70..0000000 --- a/src/propelleride/application.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "application.h" - -#include -#include - -Application::Application(int &argc, char **argv) : QApplication(argc,argv) -{ -} - -Application::~Application() -{ -} - -bool Application::event(QEvent *event) -{ - switch(event->type()) - { - case QEvent::FileOpen: - loadFile( ((QFileOpenEvent *)event)->file() ); - emit fileOpened( ((QFileOpenEvent *)event)->file() ); - return true; - default: - return QApplication::event(event); - } -} - -void Application::loadFile(const QString & filename) -{ - qDebug() << "File Name:" << filename; -} diff --git a/src/propelleride/application.h b/src/propelleride/application.h deleted file mode 100644 index c3f0ea9..0000000 --- a/src/propelleride/application.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include - -class Application : public QApplication -{ - Q_OBJECT - -public: - Application(int &argc, char** argv); - ~Application(); - -protected: - bool event(QEvent *); - -private: - void loadFile(const QString & filename); - -signals: - void fileOpened(const QString & filename); - -}; diff --git a/src/propelleride/main.cpp b/src/propelleride/main.cpp index 9d156fc..1f958a0 100644 --- a/src/propelleride/main.cpp +++ b/src/propelleride/main.cpp @@ -1,11 +1,4 @@ -#include - -#ifdef Q_OS_MAC -#include "application.h" -#else #include -#endif - #include #include #include @@ -62,11 +55,7 @@ int main(int argc, char *argv[]) qInstallMessageHandler(messageHandler); #endif -#ifdef Q_OS_MAC - Application app(argc, argv); -#else QApplication app(argc, argv); -#endif QCoreApplication::setOrganizationName("Parallax"); QCoreApplication::setOrganizationDomain("www.parallax.com"); diff --git a/src/propelleride/mainwindow.cpp b/src/propelleride/mainwindow.cpp index 43a4524..233a076 100644 --- a/src/propelleride/mainwindow.cpp +++ b/src/propelleride/mainwindow.cpp @@ -45,11 +45,6 @@ MainWindow::MainWindow(QWidget *parent) QSplitterHandle *hndl = ui.splitter->handle(1); hndl->setEnabled(false); - -#ifdef Q_OS_MAC - connect(qApp, SIGNAL(fileOpened(const QString &)), ui.editorTabs, SLOT(openFile(const QString &))); -#endif - connect(ui.editorTabs, SIGNAL(fileUpdated(int)), this, SLOT(setProject())); // File Menu diff --git a/src/propelleride/propelleride.pro b/src/propelleride/propelleride.pro index e44d9be..82f1e9b 100644 --- a/src/propelleride/propelleride.pro +++ b/src/propelleride/propelleride.pro @@ -34,7 +34,7 @@ SOURCES += \ preferences.cpp \ logging.cpp \ -HEADERS += \ +HEADERS += \ buildmanager.h \ clickable.h \ colorchooser.h \ @@ -52,11 +52,6 @@ HEADERS += \ templates/Singleton.h \ logging.h \ -macx { - SOURCES += application.cpp - HEADERS += application.h -} - OTHER_FILES += FORMS += \