Fixed dialog parents and Stopping server on delete

This commit is contained in:
Amandeep Singh
2014-02-18 18:42:41 +05:30
parent f074491e60
commit a1de26dde7
4 changed files with 4 additions and 6 deletions

View File

@@ -116,6 +116,7 @@ InvitationsRfbServer::InvitationsRfbServer()
InvitationsRfbServer::~InvitationsRfbServer()
{
stop();
KSharedConfigPtr config = KGlobal::config();
KConfigGroup krfbConfig(config,"Security");
krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);

View File

@@ -183,14 +183,12 @@ void MainWindow::toggleDesktopSharing(bool enable)
{
if(enable) {
if(!InvitationsRfbServer::instance->start()) {
KMessageBox::error(0,
KMessageBox::error(this,
i18n("Failed to start the krfb server. Desktop sharing "
"will not work. Try setting another port in the settings "
"and restart krfb."));
}
connect(qApp, SIGNAL(aboutToQuit()), InvitationsRfbServer::instance, SLOT(stop()));
} else {
disconnect(qApp, SIGNAL(aboutToQuit()), InvitationsRfbServer::instance, SLOT(stop()));
InvitationsRfbServer::instance->stop();
if(m_passwordEditable) {
m_passwordEditable = false;
@@ -232,7 +230,7 @@ void MainWindow::onContactDoubleClicked(const Tp::AccountPtr &account, const KTp
void MainWindow::pendingDesktopShareFinished(Tp::PendingOperation *operation)
{
if(operation->isError()) {
KMessageBox::error(0,
KMessageBox::error(this,
operation->errorName() + ": " + operation->errorMessage());
}
}

View File

@@ -47,7 +47,6 @@ RfbServer::RfbServer(QObject *parent)
RfbServer::~RfbServer()
{
stop();
if (d->screen) {
rfbScreenCleanup(d->screen);
}

View File

@@ -157,6 +157,7 @@ TubesRfbServer::TubesRfbServer(QObject *parent)
TubesRfbServer::~TubesRfbServer()
{
kDebug();
stop();
delete d;
}
@@ -186,7 +187,6 @@ void TubesRfbServer::startAndCheck()
//TODO listeningAddress() should be a QHostAddress
d->stubeServer->exportTcpSocket(QHostAddress(QString::fromAscii(listeningAddress())),
listeningPort());
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(stop()));
}
void TubesRfbServer::onTubeRequested()