[Kde-imaging] kdeextragear-libs-1/libkipi/libkipi

Gilles Caulier caulier.gilles at free.fr
Wed Jun 23 12:24:40 CEST 2004


CVS commit by cgilles: 

Make visible the current Album in the treeview
CCMAIL: kde-imaging at kde.org


  M +23 -11    uploadwidget.cpp   1.9


--- kdeextragear-libs-1/libkipi/libkipi/uploadwidget.cpp  #1.8:1.9
@@ -70,10 +70,13 @@ KIPI::UploadWidget::UploadWidget( KIPI::
     QString root = album.uploadRoot().path();
     QString uploadPath = album.uploadPath().path();
-    if ( !uploadPath.startsWith( root ) ) {
+    
+    if ( !uploadPath.startsWith( root ) ) 
+        {
         kdWarning(51000) << "Error in Host application: uploadPath() should start with uploadRoot()." << endl
                          << "uploadPath() = " << album.uploadPath().prettyURL() << endl
                          << "uploadRoot() = " << album.uploadRoot().prettyURL() << endl;
     }
-    else {
+    else
+        {
         uploadPath = uploadPath.mid( root.length() );
         
@@ -115,10 +118,15 @@ void KIPI::UploadWidget::load()
 
     KFileTreeViewItem* branch = m_treeView->findItem( m_item, m_handled );
-    if ( !branch ) {
+    
+    if ( !branch ) 
+        {
         kdDebug( 51000 ) << "Unable to open " << m_handled << endl;
     }
-    else {
+    else
+        {
         branch->setOpen( true );
         m_treeView->setSelected( branch, true );
+        m_treeView->ensureItemVisible ( branch );
+        
         if ( branch->alreadyListed() )
             load();
@@ -129,5 +137,6 @@ void KIPI::UploadWidget::load()
 void KIPI::UploadWidget::mkdir()
 {
-    if ( !path().isValid() ) {
+    if ( !path().isValid() ) 
+        {
         KMessageBox::error( this, i18n("Please select a directory first") );
         return;
@@ -138,4 +147,5 @@ void KIPI::UploadWidget::mkdir()
                                          i18n("<qt>Enter new directory name (to be created as subdir of %1</qt>")
                                         .arg(path().prettyURL()), "", &ok, this);
+    
     if (!ok) return;
 
@@ -144,5 +154,6 @@ void KIPI::UploadWidget::mkdir()
 
     KIO::SimpleJob* job = KIO::mkdir(url);
-    connect(job, SIGNAL(result(KIO::Job*)), this, SLOT(slotAlbumCreated(KIO::Job*)));
+    connect(job, SIGNAL(result(KIO::Job*)), 
+            this, SLOT(slotAlbumCreated(KIO::Job*)));
 }
 
@@ -150,4 +161,5 @@ void KIPI::UploadWidget::slotAlbumCreate
 {
     int code = job->error();
+    
     if ( code )
         job->showErrorDialog( this );




More information about the Kde-imaging mailing list