[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 18:48:15
Message-ID: 20101124184815.881C7AC8A2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1200333 by vhanda:

IdentifierWidget cleanup.


 M  +4 -5      identifiermodel.cpp  
 M  +2 -2      identifiermodel.h  
 M  +15 -53    identifierwidget.cpp  
 M  +1 -10     identifierwidget.h  


--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifiermodel.cpp \
#1200332:1200333 @@ -149,24 +149,23 @@
 }
 
 
-void Nepomuk::IdentifierModel::identified(int id, const QString& oldUri, const \
QString& newUri) +void Nepomuk::IdentifierModel::identified( const QUrl& oldUri, \
const QUrl& newUri)  {
-    Q_UNUSED( id );
     //kDebug() << oldUri << " -----> " << newUri;
     
     emit layoutAboutToBeChanged();
  
-    IdentifierModelTreeItem* item = m_tree->findByUri( QUrl(oldUri) );
+    IdentifierModelTreeItem* item = m_tree->findByUri( oldUri );
     if( item ) {
         kDebug() << item->url() << " -----> " << newUri;
-        item->setIdentified( QUrl(newUri) );
+        item->setIdentified( newUri );
     }
     
     emit layoutChanged();
 }
 
 
-void Nepomuk::IdentifierModel::notIdentified(int id, const QList< Soprano::Statement \
>& sts) +void Nepomuk::IdentifierModel::notIdentified( const QList< \
> Soprano::Statement >& sts )
 {
     if( sts.isEmpty() )
         return;
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifiermodel.h \
#1200332:1200333 @@ -61,8 +61,8 @@
 //         void resolveResource( const QUrl& resource, const QUrl& identified );
 //         void discardResource( const QUrl& resource );
         
-        void notIdentified( int id, const QList<Soprano::Statement> & sts );
-        void identified( int id, const QString & oldUri, const QString & newUri );
+        void notIdentified( const QList<Soprano::Statement> & sts );
+        void identified( const QUrl& oldUri, const QUrl& newUri );
 
     private:
         IdentifierModelTree * m_tree;
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifierwidget.cpp \
#1200332:1200333 @@ -47,47 +47,16 @@
     MergeConflictDelegate * delegate = new MergeConflictDelegate( m_viewConflicts, \
this );  m_viewConflicts->setModel( m_model );
     m_viewConflicts->setItemDelegate( delegate );
-    /*
-    QVBoxLayout * layout = new QVBoxLayout();
-    layout->addWidget( label );
-    layout->addWidget( m_treeView );
 
-    setLayout( layout );*/
-
-    //m_button = new QPushButton("test", this);
-    //connect( m_button, SIGNAL(clicked(bool)), this , SLOT(t()) );
-    //layout->addWidget( m_button );
-
-    //View Options
-    //m_treeView->setSelectionMode( QAbstractItemView::SingleSelection );
-    //m_treeView->setSelectionBehavior( QAbstractItemView::SelectRows );
-    //m_treeView->setHeaderHidden( true );
-    //m_treeView->setExpandsOnDoubleClick( false );
-/*
-    m_ignore = new QPushButton( "Ignore", this );
-    m_ignoreSubTree = new QPushButton( "Ignore Sub Tree", this );
-    m_identify = new QPushButton( "Identify", this );
-
-    QHBoxLayout * hBox = new QHBoxLayout();
-    hBox->addWidget( m_ignore );
-    hBox->addWidget( m_ignoreSubTree );
-    hBox->addWidget( m_identify );
-    layout->addLayout( hBox );
-
-    connect( m_ignore, SIGNAL(clicked(bool)), this, SLOT(ignore()) );
-    connect( m_ignoreSubTree, SIGNAL(clicked(bool)), this, SLOT(ignoreSubTree()) );
-    connect( m_identify, SIGNAL(clicked(bool)), this,SLOT(identify()) );*/
-
     m_identifier = new Identifier( \
QLatin1String("org.kde.nepomuk.services.nepomukbackupsync"),  \
QLatin1String("/identifier"),  QDBusConnection::sessionBus(), this );
     
     if( m_identifier->isValid() ) {
-        kDebug() << "Valid : Connecting identified signals";
-        Q_ASSERT(connect( m_identifier, SIGNAL(notIdentified(int,QString)),
-                          this, SLOT(notIdentified(int,QString)) ));
+        connect( m_identifier, SIGNAL(notIdentified(int,QString)),
+                 this, SLOT(notIdentified(int,QString)) );
         connect( m_identifier, SIGNAL(identified(int,QString,QString)),
-                 m_model, SLOT(identified(int,QString,QString)) );
+                 this, SLOT(identified(int,QString,QString)) );
     }
 
     connect( delegate, SIGNAL(requestResourceResolve(QUrl)),
@@ -96,24 +65,6 @@
              this, SLOT(ignore(QUrl)) );
 }
 
-void Nepomuk::IdentifierWidget::t()
-{
-    //kDebug() << m_model->rowCount();
-    //m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/file0");
-    //kDebug() << m_model->rowCount();
-
-    //kDebug() <<"Inserting another";
-//     m_model->debug_notIdentified(0, "res2", "/home/user/", true);
-//     
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/file2");
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/file1");
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/file3");
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/file4");
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/ZAB", true);
-//     m_model->debug_notIdentified(0, "res1", "/home/user/nepomuk/ZAB/f1");
-    //m_treeView->expandAll();
-}
-
 void Nepomuk::IdentifierWidget::ignore(const QUrl& uri)
 {
     QModelIndex index = m_viewConflicts->currentIndex();
@@ -147,12 +98,23 @@
 
 void Nepomuk::IdentifierWidget::notIdentified(int id, const QString& string)
 {
+    if( id != m_id )
+        return;
+    
     kDebug() << string;
     const Soprano::Parser* parser = \
Soprano::PluginManager::instance()->discoverParserForSerialization( \
Soprano::SerializationNQuads );  
     QList<Soprano::Statement> stList = parser->parseString( string, QUrl(), \
Soprano::SerializationNQuads ).allStatements();  
-    m_model->notIdentified( id, stList );
+    m_model->notIdentified( stList );
 }
 
+void Nepomuk::IdentifierWidget::identified(int id, const QString& oldUri, const \
QString& newUri) +{
+    if( id != m_id )
+        return;
+
+    m_model->identified( QUrl(oldUri), QUrl(newUri) );
+}
+
 #include "identifierwidget.moc"
--- trunk/KDE/kdebase/runtime/nepomuk/services/backupsync/gui/identifierwidget.h \
#1200332:1200333 @@ -43,26 +43,17 @@
         IdentifierWidget( int id, QWidget* parent = 0 );
 
     private slots:
-        void t();
-
         void identify( const QUrl & uri );
         void ignore( const QUrl & uri );
         
     private slots:
         void notIdentified( int id, const QString & string );
+        void identified( int id, const QString & oldUri, const QString & newUri );
         
     private :
         IdentifierModel * m_model;
         int m_id;
 
-        /*QTreeView * m_treeView;
-        
-        QPushButton * m_button;
-        
-        QPushButton * m_ignore;
-        QPushButton * m_ignoreSubTree;
-        QPushButton * m_identify;*/
-        
         typedef OrgKdeNepomukServicesNepomukbackupsyncIdentifierInterface \
Identifier;  Identifier * m_identifier;
     };


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

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