Commit 6178ebb6 authored by Michael Pyne's avatar Michael Pyne
Browse files

I'm pretty sure we're using KUniqueApplication::newInstance() wrong here (and...

I'm pretty sure we're using KUniqueApplication::newInstance() wrong here (and definitely ::start()) so just factor out the one thing we need to look at and use the default.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=991089
parent da1986b7
......@@ -42,41 +42,6 @@ static const char nathan[] = I18N_NOOP("Album cover manager");
static const char pascal[] = I18N_NOOP("Gimper of splash screen");
static const char laurent[] = I18N_NOOP("Porting to KDE 4 when no one else was around");
/**
* Loading from the cache can take forever, so subclass KUniqueApplication to use a quicker
* newInstance() function.
*/
class JuKApplication : public KUniqueApplication
{
public:
JuKApplication() : KUniqueApplication(), m_juk(0)
{
}
virtual ~JuKApplication()
{
delete m_juk;
m_juk = 0;
}
// Reimplementation
virtual int newInstance()
{
m_juk = new JuK;
KConfigGroup config(KGlobal::config(), "Settings");
if(!config.readEntry("StartDocked", false))
m_juk->show();
// Some single shots will allow startup to continue at this point so we can
// return.
return 0;
}
private:
JuK *m_juk;
};
int main(int argc, char *argv[])
{
KAboutData aboutData("juk", 0, ki18n("JuK"),
......@@ -109,7 +74,7 @@ int main(int argc, char *argv[])
KUniqueApplication::addCmdLineOptions();
JuKApplication a;
KUniqueApplication a;
// If this flag gets set then JuK will quit if you click the cover on the track
// announcement popup when JuK is only in the system tray (the systray has no widget).
......@@ -118,7 +83,11 @@ int main(int argc, char *argv[])
// Create the main window and such
a.start();
JuK *juk = new JuK;
KConfigGroup config(KGlobal::config(), "Settings");
if(!config.readEntry("StartDocked", false))
juk->show();
return a.exec();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment