Commit 1a52c271 authored by Rafał Malinowski's avatar Rafał Malinowski

plugins: PluginRootComponent::init returns true

Signed-off-by: Rafał Malinowski's avatarRafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent 70c62dd6
......@@ -29,7 +29,7 @@ PluginRootComponentHandler::PluginRootComponentHandler(Plugin *plugin, bool firs
if (!m_pluginRootComponent)
throw PluginActivationErrorException(plugin, tr("Cannot find required object in module %1.\nMaybe it's not Kadu-compatible plugin.").arg(plugin->name()));
if (0 != m_pluginRootComponent->init(firstLoad))
if (!m_pluginRootComponent->init(firstLoad))
throw PluginActivationErrorException(plugin, tr("Module initialization routine for %1 failed.").arg(plugin->name()));
}
......
......@@ -60,7 +60,7 @@ public:
* Kadu instance. Plugin can then do additional work if reuired (like showing configuration
* wizard window).
*/
virtual int init(bool firstLoad) = 0;
virtual bool init(bool firstLoad) = 0;
/**
* @author Rafał 'Vogel' Malinowski
......
......@@ -49,16 +49,16 @@ AmarokMediaPlayer::~AmarokMediaPlayer()
kdebugf();
}
int AmarokMediaPlayer::init(bool firstLoad)
bool AmarokMediaPlayer::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
bool res = MediaPlayer::instance()->registerMediaPlayer(this, this);
if (!res)
return 1;
return false;
MediaPlayer::instance()->setInterval(5);
return 0;
return true;
}
void AmarokMediaPlayer::done()
......
......@@ -23,7 +23,7 @@ public:
explicit AmarokMediaPlayer(QObject *parent = 0);
virtual ~AmarokMediaPlayer();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
// PlayerInfo implementation
......
......@@ -30,7 +30,7 @@ AntistringPlugin::~AntistringPlugin()
{
}
int AntistringPlugin::init(bool firstLoad)
bool AntistringPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -38,7 +38,7 @@ int AntistringPlugin::init(bool firstLoad)
AntistringConfigurationUiHandler::registerUiHandler();
AntistringNotification::registerNotifications();
return 0;
return true;
}
void AntistringPlugin::done()
......
......@@ -38,7 +38,7 @@ class AntistringPlugin : public QObject, public PluginRootComponent
public:
virtual ~AntistringPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -46,14 +46,14 @@ AutoHide::~AutoHide()
{
}
int AutoHide::init(bool firstLoad)
bool AutoHide::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/auto_hide.ui"));
MainConfigurationWindow::registerUiHandler(this);
return 0;
return true;
}
void AutoHide::done()
......
......@@ -53,7 +53,7 @@ public:
explicit AutoHide(QObject *parent = 0);
virtual ~AutoHide();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -76,14 +76,14 @@ AutoAway::~AutoAway()
StatusChangerManager::instance()->unregisterStatusChanger(autoAwayStatusChanger);
}
int AutoAway::init(bool firstLoad)
bool AutoAway::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/autoaway.ui"));
MainConfigurationWindow::registerUiHandler(this);
return 0;
return true;
}
void AutoAway::done()
......
......@@ -108,7 +108,7 @@ public:
AutoAway();
virtual ~AutoAway();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
AutoAwayStatusChanger::ChangeStatusTo changeStatusTo();
......
......@@ -75,10 +75,10 @@ AutoResponder::~AutoResponder()
disconnect(Core::instance()->chatWidgetRepository(), 0, this, 0);
}
int AutoResponder::init(bool firstLoad)
bool AutoResponder::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
return 0;
return true;
}
void AutoResponder::done()
......
......@@ -61,7 +61,7 @@ public:
virtual bool acceptMessage(const Message &message);
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
public slots:
......
......@@ -32,7 +32,7 @@ AutostatusPlugin::~AutostatusPlugin()
{
}
int AutostatusPlugin::init(bool firstLoad)
bool AutostatusPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -41,7 +41,7 @@ int AutostatusPlugin::init(bool firstLoad)
AutostatusActions::createInstance();
AutostatusActions::instance()->registerActions();
return 0;
return true;
}
void AutostatusPlugin::done()
......
......@@ -38,7 +38,7 @@ class AutostatusPlugin : public QObject, public PluginRootComponent
public:
virtual ~AutostatusPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -33,7 +33,7 @@ CenzorPlugin::~CenzorPlugin()
{
}
int CenzorPlugin::init(bool firstLoad)
bool CenzorPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -41,7 +41,7 @@ int CenzorPlugin::init(bool firstLoad)
CenzorNotification::registerNotifications();
CenzorConfigurationUiHandler::registerConfigurationUi();
return 0;
return true;
}
void CenzorPlugin::done()
......
......@@ -37,7 +37,7 @@ class CenzorPlugin : public QObject, public PluginRootComponent
public:
virtual ~CenzorPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -33,7 +33,7 @@ ChatNotifyPlugin::~ChatNotifyPlugin()
{
}
int ChatNotifyPlugin::init(bool firstLoad)
bool ChatNotifyPlugin::init(bool firstLoad)
{
if (firstLoad)
createDefaultConfiguration();
......@@ -44,7 +44,7 @@ int ChatNotifyPlugin::init(bool firstLoad)
NotificationManager::instance()->registerNotifier(NotifierInstance);
return 0;
return true;
}
void ChatNotifyPlugin::done()
......
......@@ -41,7 +41,7 @@ class ChatNotifyPlugin : public QObject, public PluginRootComponent
public:
virtual ~ChatNotifyPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......@@ -29,13 +29,13 @@ ConfigWizardPlugin::~ConfigWizardPlugin()
}
int ConfigWizardPlugin::init(bool firstLoad)
bool ConfigWizardPlugin::init(bool firstLoad)
{
ConfigWizardConfigurationUiHandler::registerActions(firstLoad);
if (firstLoad)
ConfigWizardConfigurationUiHandler::instance()->showConfigWizard();
return 0;
return true;
}
void ConfigWizardPlugin::done()
......
......@@ -37,7 +37,7 @@ class ConfigWizardPlugin : public QObject, public PluginRootComponent
public:
virtual ~ConfigWizardPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -35,7 +35,7 @@ DesktopDockingPlugin::~DesktopDockingPlugin()
{
}
int DesktopDockingPlugin::init(bool firstLoad)
bool DesktopDockingPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -45,7 +45,7 @@ int DesktopDockingPlugin::init(bool firstLoad)
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/desktop_docking.ui"));
MainConfigurationWindow::registerUiHandler(DesktopDockConfigurationUiHandler::instance());
return 0;
return true;
}
void DesktopDockingPlugin::done()
......
......@@ -38,7 +38,7 @@ class DesktopDockingPlugin : public QObject, public PluginRootComponent
public:
virtual ~DesktopDockingPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -31,14 +31,14 @@ DockingPlugin::~DockingPlugin()
{
}
int DockingPlugin::init(bool firstLoad)
bool DockingPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
DockingManager::createInstance();
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/docking.ui"));
return 0;
return true;
}
void DockingPlugin::done()
......
......@@ -37,7 +37,7 @@ class DockingPlugin : public QObject, public PluginRootComponent
public:
virtual ~DockingPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -108,7 +108,7 @@ void EmoticonsPlugin::stopConfigurator()
Configurator.reset();
}
int EmoticonsPlugin::init(bool firstLoad)
bool EmoticonsPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -118,7 +118,7 @@ int EmoticonsPlugin::init(bool firstLoad)
registerActions();
startConfigurator();
return 0;
return true;
}
void EmoticonsPlugin::done()
......
......@@ -72,7 +72,7 @@ public:
explicit EmoticonsPlugin(QObject *parent = 0);
virtual ~EmoticonsPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -45,7 +45,7 @@ EncryptionNgPlugin::~EncryptionNgPlugin()
}
int EncryptionNgPlugin::init(bool firstLoad)
bool EncryptionNgPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -56,7 +56,7 @@ int EncryptionNgPlugin::init(bool firstLoad)
MessageDialog::show(KaduIcon("dialog-error"), tr("Encryption"),
tr("The QCA OSSL plugin for libqca2 is not present!"));
return -1;
return false;
}
EncryptionNgNotification::registerNotifications();
......@@ -65,7 +65,7 @@ int EncryptionNgPlugin::init(bool firstLoad)
EncryptionActions::registerActions();
EncryptionManager::createInstance();
return 0;
return true;
}
void EncryptionNgPlugin::done()
......
......@@ -38,7 +38,7 @@ class EncryptionNgPlugin : public QObject, public PluginRootComponent
public:
virtual ~EncryptionNgPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -48,7 +48,7 @@ EngryptionNgSimlitePlugin::~EngryptionNgSimlitePlugin()
{
}
int EngryptionNgSimlitePlugin::init(bool firstLoad)
bool EngryptionNgSimlitePlugin::init(bool firstLoad)
{
if (firstLoad)
EncryptioNgSimliteKeyImporter::createInstance();
......@@ -69,7 +69,7 @@ int EngryptionNgSimlitePlugin::init(bool firstLoad)
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/encryption-ng-simlite.ui"));
MenuInventory::instance()->menu("encryption-ng")->addAction(Actions::instance()->value("simliteSendPublicKeyAction"), KaduMenu::SectionConfig);
return 0;
return true;
}
void EngryptionNgSimlitePlugin::done()
......
......@@ -44,7 +44,7 @@ class EngryptionNgSimlitePlugin : public QObject, public PluginRootComponent
public:
virtual ~EngryptionNgSimlitePlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -30,13 +30,13 @@ ExecNotifyPlugin::~ExecNotifyPlugin()
{
}
int ExecNotifyPlugin::init(bool firstLoad)
bool ExecNotifyPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
ExecNotifyInstance = new ExecNotify(this);
return 0;
return true;
}
void ExecNotifyPlugin::done()
......
......@@ -42,7 +42,7 @@ class ExecNotifyPlugin : public QObject, public PluginRootComponent
public:
virtual ~ExecNotifyPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -33,7 +33,7 @@ ExtSoundPlugin::~ExtSoundPlugin()
{
}
int ExtSoundPlugin::init(bool firstLoad)
bool ExtSoundPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -41,7 +41,7 @@ int ExtSoundPlugin::init(bool firstLoad)
SoundManager::instance()->setPlayer(ExternalPlayer::instance());
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/ext_sound.ui"));
return 0;
return true;
}
void ExtSoundPlugin::done()
......
......@@ -36,7 +36,7 @@ class ExtSoundPlugin : public QObject, public PluginRootComponent
public:
virtual ~ExtSoundPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -44,12 +44,11 @@ FalfMediaPlayer::~FalfMediaPlayer()
kdebugf();
}
int FalfMediaPlayer::init(bool firstLoad)
bool FalfMediaPlayer::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
bool res = MediaPlayer::instance()->registerMediaPlayer(this, 0);
return res ? 0 : 1;
return MediaPlayer::instance()->registerMediaPlayer(this, 0);
}
void FalfMediaPlayer::done()
......
......@@ -29,7 +29,7 @@ public:
explicit FalfMediaPlayer(QObject *parent = 0);
virtual ~FalfMediaPlayer();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
virtual QString getTitle();
......
......@@ -31,14 +31,14 @@ FiledescPlugin::~FiledescPlugin()
{
}
int FiledescPlugin::init(bool firstLoad)
bool FiledescPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
FileDescriptionInstance = new FileDescription(this);
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/filedesc.ui"));
return 0;
return true;
}
void FiledescPlugin::done()
......
......@@ -42,7 +42,7 @@ class FiledescPlugin : public QObject, public PluginRootComponent
public:
virtual ~FiledescPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -33,7 +33,7 @@ FirewallPlugin::~FirewallPlugin()
{
}
int FirewallPlugin::init(bool firstLoad)
bool FirewallPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -42,7 +42,7 @@ int FirewallPlugin::init(bool firstLoad)
FirewallNotification::registerNotifications();
FirewallConfigurationUiHandler::registerUiHandler();
return 0;
return true;
}
void FirewallPlugin::done()
......
......@@ -38,7 +38,7 @@ class FirewallPlugin : public QObject, public PluginRootComponent
public:
virtual ~FirewallPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -30,14 +30,14 @@ FreedesktopNotifyPlugin::~FreedesktopNotifyPlugin()
{
}
int FreedesktopNotifyPlugin::init(bool firstLoad)
bool FreedesktopNotifyPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
FreedesktopNotify::createInstance();
FreedesktopNotifyConfigurationUiHandler::registerConfigurationUi();
return 0;
return true;
}
void FreedesktopNotifyPlugin::done()
......
......@@ -33,7 +33,7 @@ class FreedesktopNotifyPlugin : public QObject, public PluginRootComponent
public:
virtual ~FreedesktopNotifyPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -47,12 +47,12 @@ GaduProtocolPlugin::~GaduProtocolPlugin()
{
}
int GaduProtocolPlugin::init(bool firstLoad)
bool GaduProtocolPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
if (ProtocolsManager::instance()->hasProtocolFactory("gadu"))
return 0;
return true;
#ifdef DEBUG_OUTPUT_ENABLED
// 8 bits for gadu debug
......@@ -66,7 +66,7 @@ int GaduProtocolPlugin::init(bool firstLoad)
MessageDialog::show(KaduIcon("dialog-error"), tr("Gadu-Gadu Protocol"),
tr("Cannot load Gadu-Gadu Protocol plugin. Please compile libgadu with zlib support."));
return -1;
return false;
}
gg_proxy_host = 0;
......@@ -91,7 +91,7 @@ int GaduProtocolPlugin::init(bool firstLoad)
GaduImporter::instance()->importAccounts();
GaduImporter::instance()->importContacts();
return 0;
return true;
}
void GaduProtocolPlugin::done()
......
......@@ -42,7 +42,7 @@ class GaduProtocolPlugin : public QObject, public PluginRootComponent
public:
virtual ~GaduProtocolPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
};
......
......@@ -68,20 +68,20 @@ GrowlNotify::~GrowlNotify()
kdebugf2();
}
int GrowlNotify::init(bool firstLoad)
bool GrowlNotify::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
if (!grow_is_installed())
{
QMessageBox::information(NULL, tr("Error"), tr("Growl is not installed in your system"));
return 1;
return false;
}
NotificationManager::instance()->registerNotifier(this);
createDefaultConfiguration();
return 0;
return true;
}
void GrowlNotify::done()
......
......@@ -23,7 +23,7 @@ public:
GrowlNotify(QObject *parent = 0);
~GrowlNotify();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
virtual void notify(Notification *notification);
......
......@@ -43,7 +43,7 @@ HintsPlugin::~HintsPlugin()
Instance = 0;
}
int HintsPlugin::init(bool firstLoad)
bool HintsPlugin::init(bool firstLoad)
{
Q_UNUSED(firstLoad)
......@@ -51,7 +51,7 @@ int HintsPlugin::init(bool firstLoad)
MainConfigurationWindow::registerUiFile(KaduPaths::instance()->dataPath() + QLatin1String("plugins/configuration/hints.ui"));
MainConfigurationWindow::registerUiHandler(HintManagerInstance->uiHandler());
return 0;
return true;
}
void HintsPlugin::done()
......
......@@ -47,7 +47,7 @@ public:
explicit HintsPlugin(QObject *parent = 0);
virtual ~HintsPlugin();
virtual int init(bool firstLoad);
virtual bool init(bool firstLoad);
virtual void done();
HintManager * hintsManger() { return HintManagerInstance; }
......
......@@ -43,7 +43,7 @@ HistoryPlugin::~HistoryPlugin()
{
}
int HistoryPlugin::init(bool firstLoad)
bool HistoryPlugin::init(bool firstLoad)