Quit app when not started from TB

This commit is contained in:
Ximi1970
2020-05-22 12:03:46 +02:00
parent fd7ddf2066
commit d2180423ad
3 changed files with 33 additions and 0 deletions

View File

@@ -38,6 +38,14 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
*/
m_win_ctrl = new WindowCtrl( m_preferences );
if( !m_win_ctrl->thunderbirdStart() )
{
/*
* Let's quit
*/
exit(0);
}
/*
* Setup the link
*/

View File

@@ -50,6 +50,18 @@ WindowCtrl::WindowCtrl( Preferences* pref, QObject *parent )
}
/*
* Is thunderbird our parent?
*/
bool WindowCtrl::thunderbirdStart() const
{
return isThunderbird( getPpid() );
}
/*
* Test func 1
*/
void WindowCtrl::slotWindowTest1()
{
emit signalConsole("Test 1 started");
@@ -67,6 +79,9 @@ void WindowCtrl::slotWindowTest1()
}
/*
* Test func 2
*/
void WindowCtrl::slotWindowTest2()
{
emit signalConsole("Test 2 started");
@@ -81,6 +96,9 @@ void WindowCtrl::slotWindowTest2()
}
/*
* Test func 3
*/
void WindowCtrl::slotWindowTest3()
{
emit signalConsole("Test 3 started");

View File

@@ -40,6 +40,13 @@ class WindowCtrl : public QObject
*/
explicit WindowCtrl( Preferences* pref, QObject *parent = nullptr );
/**
* @brief thunderbirdStart. Has the app been started by TB.
*
* @return True if Thunderbird is our parent.
*/
bool thunderbirdStart() const;
public slots:
/**