1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 17:14:00 +02:00

Hells. Yes. Make TH window come to front when launched with a URL. (X11, not sure if Win works yet.)

This commit is contained in:
Jeff Mitchell
2011-08-27 02:47:17 -04:00
parent 4b5caaceef
commit 87c86b6349
2 changed files with 15 additions and 2 deletions

View File

@@ -530,8 +530,14 @@ setNam( QNetworkAccessManager* nam )
qDebug() << Q_FUNC_INFO;
QWidgetList widgetList = qApp->topLevelWidgets();
int i = 0;
while( !widgetList.at( i )->isWindow() )
while( i < widgetList.count() && widgetList.at( i )->objectName() != "TH_Main_Window" )
i++;
if ( i == widgetList.count() )
{
qDebug() << Q_FUNC_INFO << " could not find main TH window";
return;
}
QWidget *widget = widgetList.at( i );
widget->show();
@@ -564,8 +570,14 @@ setNam( QNetworkAccessManager* nam )
qDebug() << Q_FUNC_INFO;
QWidgetList widgetList = qApp->topLevelWidgets();
int i = 0;
while( !widgetList.at( i )->isWindow() )
while( i < widgetList.count() && widgetList.at( i )->objectName() != "TH_Main_Window" )
i++;
if ( i == widgetList.count() )
{
qDebug() << Q_FUNC_INFO << " could not find main TH window";
return;
}
QWidget *widget = widgetList.at( i );
widget->show();

View File

@@ -222,6 +222,7 @@ TomahawkApp::init()
tDebug() << "Init MainWindow.";
m_mainwindow = new TomahawkWindow();
m_mainwindow->setWindowTitle( "Tomahawk" );
m_mainwindow->setObjectName( "TH_Main_Window" );
m_mainwindow->show();
}
#endif