mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-16 01:37:20 -05:00
Small fixes in Application.
This commit is contained in:
parent
b5249d196d
commit
76eb935024
@ -24,17 +24,13 @@ Application::Application(int& argc, char** argv)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application()
|
bool Application::event(QEvent* event)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Application::event(QEvent *event)
|
|
||||||
{
|
{
|
||||||
// Handle Apple QFileOpenEvent from finder (double click on .kdbx file)
|
// Handle Apple QFileOpenEvent from finder (double click on .kdbx file)
|
||||||
if (event->type() == QEvent::FileOpen) {
|
if (event->type() == QEvent::FileOpen) {
|
||||||
Q_EMIT openDatabase(static_cast<QFileOpenEvent*>(event)->file());
|
Q_EMIT openFile(static_cast<QFileOpenEvent*>(event)->file());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (QApplication::event(event));
|
return QApplication::event(event);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#define KEEPASSX_APPLICATION_H
|
#define KEEPASSX_APPLICATION_H
|
||||||
|
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
#include "gui/MainWindow.h"
|
|
||||||
|
|
||||||
class Application : public QApplication
|
class Application : public QApplication
|
||||||
{
|
{
|
||||||
@ -27,12 +26,11 @@ class Application : public QApplication
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Application(int& argc, char** argv);
|
Application(int& argc, char** argv);
|
||||||
~Application();
|
|
||||||
|
|
||||||
bool event(QEvent *event);
|
bool event(QEvent* event);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void openDatabase(const QString& filename);
|
void openFile(const QString& filename);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_APPLICATION_H
|
#endif // KEEPASSX_APPLICATION_H
|
||||||
|
@ -53,7 +53,7 @@ int main(int argc, char** argv)
|
|||||||
MainWindow mainWindow;
|
MainWindow mainWindow;
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
|
|
||||||
QObject::connect(&app, SIGNAL(openDatabase(QString)), &mainWindow, SLOT(openDatabase(QString)));
|
QObject::connect(&app, SIGNAL(openFile(QString)), &mainWindow, SLOT(openDatabase(QString)));
|
||||||
|
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
mainWindow.openDatabase(filename, password, QString());
|
mainWindow.openDatabase(filename, password, QString());
|
||||||
|
Loading…
Reference in New Issue
Block a user