[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/services/backupsync/gui
From:       Vishesh Handa <handa.vish () gmail ! com>
Date:       2010-11-24 14:24:09
Message-ID: 20101124142409.F41A7AC8A2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1200279 by vhanda:

Display the correct type in the IdentifierTree


 M  +3 -3      backupwizardpages.cpp  
 M  +8 -6      guitest/testwidget.cpp  
 M  +3 -0      identifiermodel.cpp  
 M  +23 -4     identifiermodeltree.cpp  
 M  +1 -0      identifiermodeltree.h  


--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/backupwizardpages.cpp \
#1200278:1200279 @@ -239,10 +239,10 @@
 
 void Nepomuk::RestorePage::slotIdentificationDone(int id, int unidentified)
 {
-    //if( id == m_id && unidentified == 0 ) {
-    //    wizard()->next();
-    //}
+    if( id == m_id && unidentified == 0 ) {
+        wizard()->next();
 }
+}
 
 //
 // Backup Settings Page
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/guitest/testwidget.cpp \
#1200278:1200279 @@ -57,11 +57,13 @@
     m_model->debug_notIdentified( "nepomuk:/res/5", "/home/vishesh/folder/fol-file1" \
                );
     m_model->debug_notIdentified( "nepomuk:/res/6", "/home/vishesh/folder/fol-file2" \
);  
-    m_model->debug_notIdentified( "nepomuk:/res/1", "/home/user/" );
-    m_model->debug_notIdentified( "nepomuk:/res/2", "/home/user/file1" );
-    m_model->debug_notIdentified( "nepomuk:/res/3", "/home/user/folder/" );
-    m_model->debug_notIdentified( "nepomuk:/res/4", "/home/user/file2" );
-    m_model->debug_notIdentified( "nepomuk:/res/5", "/home/user/folder/fol-file1" );
-    m_model->debug_notIdentified( "nepomuk:/res/6", "/home/user/folder/fol-file2" );
+    m_model->debug_notIdentified( "nepomuk:/res/-1", "/home/user/" );
+    m_model->debug_notIdentified( "nepomuk:/res/-2", "/home/user/file1" );
+    m_model->debug_notIdentified( "nepomuk:/res/-3", "/home/user/folder/" );
+    m_model->debug_notIdentified( "nepomuk:/res/-4", "/home/user/file2" );
+    m_model->debug_notIdentified( "nepomuk:/res/-5", "/home/user/folder/fol-file1" \
); +    m_model->debug_notIdentified( "nepomuk:/res/-6", \
"/home/user/folder/fol-file2" ); +
+    m_model->identified(0, "nepomuk:/res/-5", "nepomuk:/res/-5-identified" );
 }
 
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifiermodel.cpp \
#1200278:1200279 @@ -230,6 +230,9 @@
     if( nieUrl.endsWith('/') ) {
         stList << Soprano::Statement( QUrl(resUri), \
Soprano::Vocabulary::RDF::type(), Nepomuk::Vocabulary::NFO::Folder() );  }
+    else {
+        stList << Soprano::Statement( QUrl(resUri), \
Soprano::Vocabulary::RDF::type(), Nepomuk::Vocabulary::NFO::FileDataObject() ); +    \
}  
     notIdentified( 0, stList );
 }
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifiermodeltree.cpp \
#1200278:1200279 @@ -27,7 +27,10 @@
 #include <Soprano/Vocabulary/RDF>
 
 #include <Soprano/Statement>
+#include <Soprano/Vocabulary/RDFS>
 
+#include <Nepomuk/Types/Class>
+
 Nepomuk::IdentifierModelTreeItem::IdentifierModelTreeItem(const QString& url, bool \
isFolder)  : FileSystemTreeItem( url, isFolder )
 {
@@ -36,8 +39,7 @@
 
 QUrl Nepomuk::IdentifierModelTreeItem::type() const
 {
-    //TODO: Implement me!
-    return Nepomuk::Vocabulary::NFO::Audio();
+    return m_type;
 }
 
 QString Nepomuk::IdentifierModelTreeItem::toString() const
@@ -77,6 +79,8 @@
     
     bool isFolder = false;
     QString url;
+    QUrl type = Soprano::Vocabulary::RDFS::Resource();
+    
     foreach( const Soprano::Statement & st, stList ) {
         if( st.predicate().uri() == nieUrl ) {
             url = st.object().uri().toLocalFile();
@@ -84,12 +88,27 @@
                 url = url.mid( 7 );
         }
         else if( st.predicate().uri() == rdfType ) {
-            if( st.object().uri() == nfoFolder )
+            QUrl objectUri = st.object().uri();
+            if( objectUri == nfoFolder )
                 isFolder = true;
+
+            // Get the correct type and store it into type
+            // FIXME: This may not be totally accurate
+            Types::Class oldClass( type );
+            Types::Class newClass( objectUri );
+            kDebug() << "Object uri : " << objectUri;
+            if( newClass.isSubClassOf( oldClass ) ) {
+                kDebug() << "SETTING";
+                type = objectUri;
         }
     }
+    }
     
-    return new IdentifierModelTreeItem( url, isFolder );
+    IdentifierModelTreeItem* item = new IdentifierModelTreeItem( url, isFolder );
+    item->m_statements = stList;
+    item->m_type = type;
+
+    return item;
 }
 
 QUrl Nepomuk::IdentifierModelTreeItem::resourceUri() const
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifiermodeltree.h \
#1200278:1200279 @@ -55,6 +55,7 @@
         QUrl m_identifiedUrl;
         bool m_discarded;
         QList<Soprano::Statement> m_statements;
+        QUrl m_type;
 
         friend class IdentifierModelTree;
     };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic