Commit 0e0318e5 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

use dedicated namespace

parent 23eae235
......@@ -43,11 +43,14 @@
#include "removeredeyeswindow.h"
namespace KIPIRemoveRedEyesPlugin
{
K_PLUGIN_FACTORY( RemoveRedEyesFactory, registerPlugin<Plugin_RemoveRedEyes>(); )
K_EXPORT_PLUGIN ( RemoveRedEyesFactory("kipiplugin_removeredeyes") )
Plugin_RemoveRedEyes::Plugin_RemoveRedEyes(QObject* parent, const QVariantList& /*args*/)
: KIPI::Plugin(RemoveRedEyesFactory::componentData(), parent, "RemoveRedEyes"),
Plugin_RemoveRedEyes::Plugin_RemoveRedEyes(QObject* const parent, const QVariantList& /*args*/)
: Plugin(RemoveRedEyesFactory::componentData(), parent, "RemoveRedEyes"),
m_action(0)
{
kDebug(AREA_CODE_LOADING) << "Plugin_RemoveRedEyes plugin loaded";
......@@ -55,7 +58,7 @@ Plugin_RemoveRedEyes::Plugin_RemoveRedEyes(QObject* parent, const QVariantList&
void Plugin_RemoveRedEyes::setup(QWidget* widget)
{
KIPI::Plugin::setup(widget);
Plugin::setup(widget);
m_action = actionCollection()->addAction("removeredeyes");
m_action->setText(i18n("&Red-Eye Removal..."));
......@@ -66,7 +69,7 @@ void Plugin_RemoveRedEyes::setup(QWidget* widget)
addAction(m_action);
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*> (parent());
Interface* interface = dynamic_cast<Interface*> (parent());
if (!interface)
{
......@@ -84,7 +87,7 @@ Plugin_RemoveRedEyes::~Plugin_RemoveRedEyes()
void Plugin_RemoveRedEyes::activate()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*> (parent());
Interface* interface = dynamic_cast<Interface*> (parent());
if (!interface)
{
......@@ -92,18 +95,19 @@ void Plugin_RemoveRedEyes::activate()
return;
}
KIPIRemoveRedEyesPlugin::RemoveRedEyesWindow* window =
new KIPIRemoveRedEyesPlugin::RemoveRedEyesWindow(interface);
RemoveRedEyesWindow* window = new RemoveRedEyesWindow(interface);
window->show();
}
KIPI::Category Plugin_RemoveRedEyes::category(KAction* action) const
Category Plugin_RemoveRedEyes::category(KAction* action) const
{
if (action == m_action)
{
return KIPI::BatchPlugin;
return BatchPlugin;
}
kWarning() << "Unrecognized action for plugin category identification";
return KIPI::BatchPlugin; // no warning from compiler, please
return BatchPlugin; // no warning from compiler, please
}
} // namespace KIPIRemoveRedEyesPlugin
......@@ -35,16 +35,21 @@
class KAction;
class Plugin_RemoveRedEyes: public KIPI::Plugin
using namespace KIPI;
namespace KIPIRemoveRedEyesPlugin
{
class Plugin_RemoveRedEyes: public Plugin
{
Q_OBJECT
public:
Plugin_RemoveRedEyes(QObject* parent, const QVariantList& args);
Plugin_RemoveRedEyes(QObject* const parent, const QVariantList& args);
~Plugin_RemoveRedEyes();
KIPI::Category category(KAction* action) const;
Category category(KAction* action) const;
void setup(QWidget* widget);
private Q_SLOTS:
......@@ -56,4 +61,6 @@ private:
KAction* m_action;
};
} // namespace KIPIRemoveRedEyesPlugin
#endif // PLUGIN_REMOVEREDEYES_H
......@@ -44,11 +44,12 @@
#include "sendimages.h"
#include "sendimagesdialog.h"
namespace KIPISendimagesPlugin
{
K_PLUGIN_FACTORY( SendImagesFactory, registerPlugin<Plugin_SendImages>(); )
K_EXPORT_PLUGIN ( SendImagesFactory("kipiplugin_sendimages") )
using namespace KIPISendimagesPlugin;
class Plugin_SendImages::Plugin_SendImagesPriv
{
public:
......@@ -68,7 +69,7 @@ public:
};
Plugin_SendImages::Plugin_SendImages(QObject* const parent, const QVariantList&)
: KIPI::Plugin(SendImagesFactory::componentData(), parent, "SendImages"),
: Plugin(SendImagesFactory::componentData(), parent, "SendImages"),
d(new Plugin_SendImagesPriv)
{
kDebug(AREA_CODE_LOADING) << "Plugin_SendImages plugin loaded";
......@@ -81,7 +82,7 @@ Plugin_SendImages::~Plugin_SendImages()
void Plugin_SendImages::setup( QWidget* widget )
{
KIPI::Plugin::setup( widget );
Plugin::setup( widget );
d->action_sendimages = actionCollection()->addAction("sendimages");
d->action_sendimages->setText(i18n("Email Images..."));
......@@ -92,14 +93,14 @@ void Plugin_SendImages::setup( QWidget* widget )
addAction(d->action_sendimages);
KIPI::Interface* interface = dynamic_cast< KIPI::Interface* >( parent() );
Interface* interface = dynamic_cast< Interface* >( parent() );
if ( !interface )
{
kError() << "Kipi interface is null!";
return;
}
KIPI::ImageCollection selection = interface->currentSelection();
ImageCollection selection = interface->currentSelection();
d->action_sendimages->setEnabled(selection.isValid() && !selection.images().isEmpty() );
connect(interface, SIGNAL(selectionChanged(bool)),
......@@ -108,14 +109,14 @@ void Plugin_SendImages::setup( QWidget* widget )
void Plugin_SendImages::slotActivate()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>( parent() );
Interface* interface = dynamic_cast<Interface*>( parent() );
if ( !interface )
{
kError() << "Kipi interface is null!";
return;
}
KIPI::ImageCollection images = interface->currentSelection();
ImageCollection images = interface->currentSelection();
if ( !images.isValid() || images.images().isEmpty() )
return;
......@@ -131,7 +132,7 @@ void Plugin_SendImages::slotActivate()
void Plugin_SendImages::slotPrepareEmail()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>( parent() );
Interface* interface = dynamic_cast<Interface*>( parent() );
if ( !interface )
{
kError() << "Kipi interface is null!";
......@@ -139,15 +140,17 @@ void Plugin_SendImages::slotPrepareEmail()
}
EmailSettings settings = d->dialog->emailSettings();
d->sendImagesOperation = new SendImages(settings, this);
d->sendImagesOperation = new SendImages(settings, this);
d->sendImagesOperation->sendImages();
}
KIPI::Category Plugin_SendImages::category( KAction* action ) const
Category Plugin_SendImages::category( KAction* action ) const
{
if ( action == d->action_sendimages )
return KIPI::ExportPlugin;
return ExportPlugin;
kWarning() << "Unrecognized action for plugin category identification";
return KIPI::ExportPlugin; // no warning from compiler, please
return ExportPlugin; // no warning from compiler, please
}
} // namespace KIPISendimagesPlugin
......@@ -36,7 +36,12 @@ class QObject;
class KAction;
class Plugin_SendImages : public KIPI::Plugin
using namespace KIPI;
namespace KIPISendimagesPlugin
{
class Plugin_SendImages : public Plugin
{
Q_OBJECT
......@@ -45,7 +50,7 @@ public:
Plugin_SendImages(QObject* const parent, const QVariantList& args);
~Plugin_SendImages();
virtual KIPI::Category category( KAction* action ) const;
virtual Category category( KAction* action ) const;
virtual void setup( QWidget* );
public Q_SLOTS:
......@@ -62,4 +67,6 @@ private:
Plugin_SendImagesPriv* const d;
};
} // namespace KIPISendimagesPlugin
#endif // PLUGIN_SENDIMAGES_H
......@@ -7,9 +7,9 @@
* Description : a kipi plugin to export images to shwup.com web service
*
* Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
* Copyright (C) 2008-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2009 by Luka Renko <lure at kubuntu dot org>
* Copyright (C) 2009 by Timothee Groleau <kde at timotheegroleau dot com>
* Copyright (C) 2009 by Timothee Groleau <kde at timotheegroleau dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -57,20 +57,24 @@ extern "C"
#include "swwindow.h"
namespace KIPIShwupPlugin
{
K_PLUGIN_FACTORY( ShwupFactory, registerPlugin<Plugin_Shwup>(); )
K_EXPORT_PLUGIN ( ShwupFactory("kipiplugin_shwup") )
Plugin_Shwup::Plugin_Shwup(QObject* parent, const QVariantList& /*args*/)
: KIPI::Plugin(ShwupFactory::componentData(), parent, "Shwup Export")
Plugin_Shwup::Plugin_Shwup(QObject* const parent, const QVariantList& /*args*/)
: Plugin(ShwupFactory::componentData(), parent, "Shwup Export")
{
kDebug(AREA_CODE_LOADING) << "Plugin_Shwup plugin loaded";
m_dlgExport = 0;
m_actionExport = 0;
}
void Plugin_Shwup::setup(QWidget* widget)
{
m_dlgExport = 0;
KIPI::Plugin::setup(widget);
Plugin::setup(widget);
KIconLoader::global()->addAppDir("kipiplugin_shwup");
......@@ -84,7 +88,7 @@ void Plugin_Shwup::setup(QWidget* widget)
addAction(m_actionExport);
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
......@@ -101,7 +105,7 @@ Plugin_Shwup::~Plugin_Shwup()
void Plugin_Shwup::slotExport()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
......@@ -114,7 +118,7 @@ void Plugin_Shwup::slotExport()
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new KIPIShwupPlugin::SwWindow(interface, tmp, kapp->activeWindow());
m_dlgExport = new SwWindow(interface, tmp, kapp->activeWindow());
}
else
{
......@@ -127,11 +131,13 @@ void Plugin_Shwup::slotExport()
m_dlgExport->reactivate();
}
KIPI::Category Plugin_Shwup::category(KAction* action) const
Category Plugin_Shwup::category(KAction* action) const
{
if (action == m_actionExport)
return KIPI::ExportPlugin;
return ExportPlugin;
kWarning() << "Unrecognized action for plugin category identification";
return KIPI::ExportPlugin;
return ExportPlugin;
}
} // namespace KIPIShwupPlugin
......@@ -7,9 +7,9 @@
* Description : a kipi plugin to export images to shwup.com web service
*
* Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
* Copyright (C) 2008-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2009 by Luka Renko <lure at kubuntu dot org>
* Copyright (C) 2009 by Timothée Groleau <kde at timotheegroleau dot com>
* Copyright (C) 2009 by Timothée Groleau <kde at timotheegroleau dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -36,21 +36,23 @@
class KAction;
using namespace KIPI;
namespace KIPIShwupPlugin
{
class SwWindow;
}
class Plugin_Shwup : public KIPI::Plugin
class SwWindow;
class Plugin_Shwup : public Plugin
{
Q_OBJECT
public:
Plugin_Shwup(QObject* parent, const QVariantList& args);
Plugin_Shwup(QObject* const parent, const QVariantList& args);
~Plugin_Shwup();
virtual KIPI::Category category(KAction* action) const;
virtual Category category(KAction* action) const;
virtual void setup(QWidget*);
public Q_SLOTS:
......@@ -59,8 +61,10 @@ public Q_SLOTS:
private:
KAction* m_actionExport;
KIPIShwupPlugin::SwWindow* m_dlgExport;
KAction* m_actionExport;
SwWindow* m_dlgExport;
};
} // namespace KIPIShwupPlugin
#endif // PLUGIN_SHWUP_H
......@@ -57,21 +57,26 @@ extern "C"
#include "smugwindow.h"
namespace KIPISmugPlugin
{
K_PLUGIN_FACTORY( SmugFactory, registerPlugin<Plugin_Smug>(); )
K_EXPORT_PLUGIN ( SmugFactory("kipiplugin_smug") )
Plugin_Smug::Plugin_Smug(QObject* parent, const QVariantList& /*args*/)
: KIPI::Plugin(SmugFactory::componentData(), parent, "Smug")
Plugin_Smug::Plugin_Smug(QObject* const parent, const QVariantList& /*args*/)
: Plugin(SmugFactory::componentData(), parent, "Smug")
{
m_dlgImport = 0;
m_dlgExport = 0;
kDebug(AREA_CODE_LOADING) << "Plugin_Smug plugin loaded";
m_dlgImport = 0;
m_dlgExport = 0;
m_actionExport = 0;
m_actionImport = 0;
}
void Plugin_Smug::setup(QWidget* widget)
{
KIPI::Plugin::setup(widget);
Plugin::setup(widget);
KIconLoader::global()->addAppDir("kipiplugin_smug");
......@@ -95,7 +100,7 @@ void Plugin_Smug::setup(QWidget* widget)
addAction(m_actionImport);
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
......@@ -114,7 +119,7 @@ Plugin_Smug::~Plugin_Smug()
void Plugin_Smug::slotExport()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
......@@ -127,7 +132,7 @@ void Plugin_Smug::slotExport()
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new KIPISmugPlugin::SmugWindow(interface, tmp, false, kapp->activeWindow());
m_dlgExport = new SmugWindow(interface, tmp, false, kapp->activeWindow());
}
else
{
......@@ -142,7 +147,7 @@ void Plugin_Smug::slotExport()
void Plugin_Smug::slotImport()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
......@@ -155,7 +160,7 @@ void Plugin_Smug::slotImport()
if (!m_dlgImport)
{
// We clean it up in the close button
m_dlgImport = new KIPISmugPlugin::SmugWindow(interface, tmp, true, kapp->activeWindow());
m_dlgImport = new SmugWindow(interface, tmp, true, kapp->activeWindow());
}
else
{
......@@ -168,13 +173,15 @@ void Plugin_Smug::slotImport()
m_dlgImport->show();
}
KIPI::Category Plugin_Smug::category( KAction* action ) const
Category Plugin_Smug::category( KAction* action ) const
{
if (action == m_actionExport)
return KIPI::ExportPlugin;
return ExportPlugin;
else if (action == m_actionImport)
return KIPI::ImportPlugin;
return ImportPlugin;
kWarning() << "Unrecognized action for plugin category identification";
return KIPI::ExportPlugin;
return ExportPlugin;
}
} // namespace KIPISmugPlugin
......@@ -8,7 +8,7 @@
* SmugMug web service
*
* Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
* Copyright (C) 2008-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2008-2009 by Luka Renko <lure at kubuntu dot org>
*
* This program is free software; you can redistribute it
......@@ -36,21 +36,23 @@
class KAction;
using namespace KIPI;
namespace KIPISmugPlugin
{
class SmugWindow;
}
class Plugin_Smug : public KIPI::Plugin
class SmugWindow;
class Plugin_Smug : public Plugin
{
Q_OBJECT
public:
Plugin_Smug(QObject* parent, const QVariantList& args);
Plugin_Smug(QObject* const parent, const QVariantList& args);
~Plugin_Smug();
KIPI::Category category(KAction* action) const;
Category category(KAction* action) const;
void setup(QWidget*);
public Q_SLOTS:
......@@ -60,11 +62,13 @@ public Q_SLOTS:
private:
KAction* m_actionExport;
KAction* m_actionImport;
KAction* m_actionExport;
KAction* m_actionImport;
KIPISmugPlugin::SmugWindow* m_dlgExport;
KIPISmugPlugin::SmugWindow* m_dlgImport;
SmugWindow* m_dlgExport;
SmugWindow* m_dlgImport;
};
} // namespace KIPISmugPlugin
#endif // PLUGIN_SMUG_H
......@@ -21,7 +21,7 @@
*
* ============================================================ */
#include "plugin_vkontakte.h"
#include "plugin_vkontakte.moc"
// KDE includes
......@@ -43,26 +43,27 @@
#include "vkwindow.h"
namespace KIPIVkontaktePlugin
{
K_PLUGIN_FACTORY( Factory, registerPlugin<Plugin_Vkontakte>(); )
K_EXPORT_PLUGIN ( Factory("kipiplugin_vkontakte") )
Plugin_Vkontakte::Plugin_Vkontakte(QObject *parent, const QVariantList&)
Plugin_Vkontakte::Plugin_Vkontakte(QObject* const parent, const QVariantList&)
: Plugin(Factory::componentData(), parent, "VKontakte")
{
m_dlgExport = 0;
// m_dlgImport = 0;
kDebug(AREA_CODE_LOADING) << "Plugin_Vkontakte plugin loaded" ;
}
void Plugin_Vkontakte::setup(QWidget *widget)
void Plugin_Vkontakte::setup(QWidget* widget)
{
KIPI::Plugin::setup(widget);
Plugin::setup(widget);
KIconLoader::global()->addAppDir("kipiplugin_vkontakte");
m_actionExport = actionCollection()->addAction("VKontakte");
m_actionExport->setText(i18n("Export to &VKontakte..."));
// TODO: icon file
......@@ -75,7 +76,7 @@ void Plugin_Vkontakte::setup(QWidget *widget)
addAction(m_actionExport);
KIPI::Interface *interface = dynamic_cast<KIPI::Interface*>(parent());
Interface *interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
......@@ -100,7 +101,7 @@ void Plugin_Vkontakte::slotImport()
void Plugin_Vkontakte::slotExport()
{
KIPI::Interface* interface = dynamic_cast<KIPI::Interface*>(parent());
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
......@@ -112,7 +113,7 @@ void Plugin_Vkontakte::slotExport()
{
// This object will live forever, we will reuse it on future accesses
// to the plugin.
m_dlgExport = new KIPIVkontaktePlugin::VkontakteWindow(interface,
m_dlgExport = new VkontakteWindow(interface,
false, kapp->activeWindow());
}
else
......@@ -126,15 +127,16 @@ void Plugin_Vkontakte::slotExport()
m_dlgExport->startReactivation();
}
KIPI::Category Plugin_Vkontakte::category(KAction *action) const
Category Plugin_Vkontakte::category(KAction* action) const
{
if (action == m_actionExport)
{
return KIPI::ExportPlugin;
return ExportPlugin;
}
kWarning() << "Unrecognized action for plugin category identification" ;
return KIPI::ExportPlugin;
return ExportPlugin;
}
#include "plugin_vkontakte.moc"
} // namespace KIPIVkontaktePlugin
......@@ -36,16 +36,21 @@
#include "vkwindow.h"
class Plugin_Vkontakte : public KIPI::Plugin
using namespace KIPI;
namespace KIPIVkontaktePlugin
{
class Plugin_Vkontakte : public Plugin
{
Q_OBJECT
public:
Plugin_Vkontakte(QObject *parent, const QVariantList &args);
Plugin_Vkontakte(QObject* const parent, const QVariantList& args);
~Plugin_Vkontakte();
virtual KIPI::Category category(KAction *action) const;
virtual Category category(KAction *action) const;
virtual void setup(QWidget*);
public Q_SLOTS:
......@@ -55,8 +60,10 @@ public Q_SLOTS: