The controller is globally accesible

The controller class has some important methods which may be
required in multiple parts of the code. Now that class is a
singleton (that may change in the future).
The core parts have been moved to src/core.
Now the tray Icon can be disabled by the controller.
I need to reimplement a new notification system due to its
dependency with the tray icon, they are disabled in this actual
commit.
This commit is contained in:
lupoDharkael
2017-07-28 11:34:39 +02:00
parent 165939c88f
commit 3199059ede
11 changed files with 99 additions and 93 deletions

View File

@@ -15,9 +15,9 @@
// You should have received a copy of the GNU General Public License
// along with Flameshot. If not, see <http://www.gnu.org/licenses/>.
#include "controller.h"
#include "src/core/controller.h"
#include "singleapplication.h"
#include "src/flameshotdbusadapter.h"
#include "src/core/flameshotdbusadapter.h"
#include <QApplication>
#include <QTranslator>
#include <QObject>
@@ -39,10 +39,10 @@ int main(int argc, char *argv[]) {
app.setApplicationName("flameshot");
app.setOrganizationName("Dharkael");
Controller c;
new FlameshotDBusAdapter(&c);
auto c = Controller::getInstance();
new FlameshotDBusAdapter(c);
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.registerObject("/", &c);
dbus.registerObject("/", c);
dbus.registerService("org.dharkael.Flameshot");
return app.exec();
}