Commit 1d3a7920 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent ccc30144
......@@ -58,7 +58,6 @@ Plugin_iPodExport::Plugin_iPodExport(QObject* const parent, const QVariantList&)
: Plugin( IpodFactory::componentData(), parent, "iPodExport")
{
m_dlgImageUpload = 0;
m_interface = 0;
kDebug(AREA_CODE_LOADING) << "Plugin_iPodExport plugin loaded" ;
......@@ -78,15 +77,13 @@ void Plugin_iPodExport::setup(QWidget* widget)
this, SLOT(slotImageUpload()));
addAction(m_actionImageUpload);
m_interface = dynamic_cast<Interface*>(parent());
}
void Plugin_iPodExport::slotImageUpload()
{
if (!m_dlgImageUpload)
{
m_dlgImageUpload = new UploadDialog(m_interface, i18n("iPod Export"), kapp->activeWindow());
m_dlgImageUpload = new UploadDialog(i18n("iPod Export"), kapp->activeWindow());
}
else
{
......
......@@ -34,11 +34,6 @@
class KAction;
namespace KIPI
{
class Interface;
}
using namespace KIPI;
namespace KIPIIpodExportPlugin
......@@ -66,8 +61,6 @@ private:
KAction* m_actionImageUpload;
Interface* m_interface;
UploadDialog* m_dlgImageUpload;
};
......
......@@ -87,26 +87,17 @@ namespace KIPIIpodExportPlugin
UploadDialog* UploadDialog::s_instance = 0;
UploadDialog::UploadDialog
(
#if KIPI_PLUGIN
Interface* const interface,
#endif
const QString& caption, QWidget* const /*parent*/ )
: KPToolDialog(0)
, m_transferring( false )
#if KIPI_PLUGIN
, m_interface( interface )
#endif
, m_itdb( 0 )
, m_ipodInfo( 0 )
, m_ipodHeader( 0 )
, m_mountPoint( QString() )
, m_deviceNode( QString() )
, m_ipodAlbumList( 0 )
UploadDialog::UploadDialog(const QString& caption, QWidget* const /*parent*/)
: KPToolDialog(0),
m_transferring(false),
m_itdb(0),
m_ipodInfo(0),
m_ipodHeader(0),
m_mountPoint(QString()),
m_deviceNode(QString()),
m_ipodAlbumList(0)
{
s_instance = this;
QWidget* box = new QWidget();
setMainWidget( box );
setCaption( caption );
......@@ -298,7 +289,7 @@ void UploadDialog::loadImagesFromCurrentSelection()
{
#if KIPI_PLUGIN
/// add selected items to the ImageList
ImageCollection images = m_interface->currentSelection();
ImageCollection images = iface()->currentSelection();
if( images.isValid() )
{
......@@ -591,7 +582,7 @@ void UploadDialog::createIpodAlbum()
QString helper;
#if KIPI_PLUGIN
ImageCollection album = m_interface->currentAlbum();
ImageCollection album = iface()->currentAlbum();
if( album.isValid() )
helper = album.name();
#endif
......
......@@ -77,12 +77,7 @@ class UploadDialog : public KPToolDialog
public:
UploadDialog(
#if KIPI_PLUGIN
Interface* const interface,
#endif
const QString& caption, QWidget* const parent=0 );
UploadDialog(const QString& caption, QWidget* const parent=0);
~UploadDialog();
QString ipodModel() const;
......@@ -140,10 +135,6 @@ private:
bool m_transferring;
#if KIPI_PLUGIN
Interface* m_interface;
#endif
Itdb_PhotoDB* m_itdb;
Itdb_IpodInfo* m_ipodInfo;
IpodHeader* m_ipodHeader;
......
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