[Kde-imaging] kdeextragear-libs-1/libkipi/libkipi
Gilles Caulier
caulier.gilles at free.fr
Tue Jun 29 10:25:15 CEST 2004
CVS commit by cgilles:
Added a new signal when a current folder have changed in the TreeView.
Fixed a problem if no current Album have selected in the Host (in this case, using the first
album of the collection list from the host).
CCMAIL: kde-imaging at kde.org
M +19 -3 uploadwidget.cpp 1.10
M +11 -4 uploadwidget.h 1.5
--- kdeextragear-libs-1/libkipi/libkipi/uploadwidget.cpp #1.9:1.10
@@ -1,5 +1,5 @@
/* ============================================================
* File : uploadwidget.cpp
- * Authors: KIPI team developers
+ * Authors: KIPI team developers (see AUTHORS files for details)
*
* Date : 2004-02
@@ -25,4 +25,5 @@
#include <qlayout.h>
#include <qheader.h>
+#include <qlistview.h>
// KDE includes
@@ -53,5 +54,5 @@
KIPI::UploadWidget::UploadWidget( KIPI::Interface* interface, QWidget* parent, const char* name )
- :QWidget( parent, name )
+ : QWidget( parent, name )
{
QVBoxLayout* layout = new QVBoxLayout( this, 0 );
@@ -61,4 +62,9 @@ KIPI::UploadWidget::UploadWidget( KIPI::
// Fetch the current album, so we can start out there.
KIPI::ImageCollection album = interface->currentAlbum();
+
+ // If no current album selected, get the first album in the list.
+ if ( !album.isValid() )
+ album = interface->allAlbums().first();
+
m_item = m_treeView->addBranch( album.uploadRoot(), album.uploadRootName() );
m_treeView->setDirOnlyMode( m_item, true );
@@ -91,4 +97,7 @@ KIPI::UploadWidget::UploadWidget( KIPI::
this, SLOT( load() ) );
}
+
+ connect( m_treeView, SIGNAL( executed(QListViewItem *) ),
+ this, SLOT( slotFolderSelected(QListViewItem *) ) );
}
@@ -113,6 +122,7 @@ void KIPI::UploadWidget::load()
// Bugfix by Gilles (23/06/2004) : It's work fine like this with Digikam and Kimdaba.
// This is must be tested with Gwenview
-
+ //
//m_handled += "/" + item;
+
m_handled += item;
@@ -154,4 +164,5 @@ void KIPI::UploadWidget::mkdir()
KIO::SimpleJob* job = KIO::mkdir(url);
+
connect(job, SIGNAL(result(KIO::Job*)),
this, SLOT(slotAlbumCreated(KIO::Job*)));
@@ -166,3 +177,8 @@ void KIPI::UploadWidget::slotAlbumCreate
}
+void KIPI::UploadWidget::slotFolderSelected(QListViewItem *)
+{
+ emit folderItemSelected(m_treeView->currentURL());
+}
+
#include "uploadwidget.moc"
--- kdeextragear-libs-1/libkipi/libkipi/uploadwidget.h #1.4:1.5
@@ -1,10 +1,10 @@
/* ============================================================
* File : uploadwidget.h
- * Authors: Jesper K. Pedersen <blackie at kde.org>
+ * Authors: KIPI team developers (see AUTHORS files for details)
*
* Date : 2004-02-19
* Description :
*
- * Copyright 2004 by Jesper K. Pedersen
+ * Copyright 2004 by the KIPI team
*
* This program is free software; you can redistribute it
@@ -32,4 +32,5 @@
#include <kfiletreeview.h>
+#include <kurl.h>
// LibKIPI includes.
@@ -37,7 +38,10 @@
#include <libkipi/interface.h>
+class QListViewItem;
+
namespace KIPI
{
- class UploadWidget :public QWidget {
+ class UploadWidget :public QWidget
+ {
Q_OBJECT
@@ -49,7 +53,11 @@ namespace KIPI
void mkdir();
+ signals :
+ void folderItemSelected(const KURL &url);
+
protected slots:
void load();
void slotAlbumCreated(KIO::Job* job);
+ void slotFolderSelected(QListViewItem *);
private:
More information about the Kde-imaging
mailing list