mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 04:36:34 +01:00
[QtSingleApplication] Correctly remove lockfile only on app close.
Fixes regression when multiple instances of browser were opened.
This commit is contained in:
parent
7c57588738
commit
43d514a647
4
src/lib/3rdparty/qtlocalpeer.cpp
vendored
4
src/lib/3rdparty/qtlocalpeer.cpp
vendored
@ -178,6 +178,10 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
|
||||
return res;
|
||||
}
|
||||
|
||||
void QtLocalPeer::removeLockedFile()
|
||||
{
|
||||
lockFile.remove();
|
||||
}
|
||||
|
||||
void QtLocalPeer::receiveConnection()
|
||||
{
|
||||
|
1
src/lib/3rdparty/qtlocalpeer.h
vendored
1
src/lib/3rdparty/qtlocalpeer.h
vendored
@ -68,6 +68,7 @@ public:
|
||||
bool sendMessage(const QString &message, int timeout);
|
||||
QString applicationId() const
|
||||
{ return id; }
|
||||
void removeLockedFile();
|
||||
|
||||
Q_SIGNALS:
|
||||
void messageReceived(const QString &message);
|
||||
|
2
src/lib/3rdparty/qtlockedfile_unix.cpp
vendored
2
src/lib/3rdparty/qtlockedfile_unix.cpp
vendored
@ -123,7 +123,5 @@ QtLockedFile::~QtLockedFile()
|
||||
if (isOpen()) {
|
||||
unlock();
|
||||
}
|
||||
|
||||
remove();
|
||||
}
|
||||
|
||||
|
5
src/lib/3rdparty/qtsingleapplication.cpp
vendored
5
src/lib/3rdparty/qtsingleapplication.cpp
vendored
@ -277,6 +277,11 @@ QWidget* QtSingleApplication::activationWindow() const
|
||||
return actWin;
|
||||
}
|
||||
|
||||
void QtSingleApplication::removeLockedFile()
|
||||
{
|
||||
peer->removeLockedFile();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
De-minimizes, raises, and activates this application's activation window.
|
||||
|
2
src/lib/3rdparty/qtsingleapplication.h
vendored
2
src/lib/3rdparty/qtsingleapplication.h
vendored
@ -84,6 +84,8 @@ public:
|
||||
void initialize(bool dummy = true)
|
||||
{ isRunning(); Q_UNUSED(dummy) }
|
||||
|
||||
void removeLockedFile();
|
||||
|
||||
public Q_SLOTS:
|
||||
bool sendMessage(const QString &message, int timeout = 5000);
|
||||
void activateWindow();
|
||||
|
@ -747,6 +747,7 @@ void MainApplication::quitApplication()
|
||||
//
|
||||
// * this can occur on Mac OS (see #157)
|
||||
|
||||
removeLockedFile();
|
||||
quit();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user