I am sorry for the earlier version as it had mistakes and did not get the
job done, i have fixed it but since i am not able to run the query to check
it myself, i request you guys to inform me if there are any irregularities,
i will get them sorted ASAP, again sorry for the blunder earlier .

 Also my real name is "Smit Shah" for future references.
diff --git a/querymodel.cpp b/querymodel.cpp
index d78a865..d94da7b 100644
--- a/querymodel.cpp
+++ b/querymodel.cpp
@@ -273,6 +273,13 @@ void Nepomuk::QueryModel::stopQuery()
     d->m_currentQuery = 0;
 }
 
-
+bool Nepomuk::QueryModel::checkStatus()
+{  if(d->m_currentQuery!=0)
+    return false;
+    else
+        return true;
+}
 
 #include "querymodel.moc"
+
+
diff --git a/querymodel.h b/querymodel.h
index 698dfee..eb755c2 100644
--- a/querymodel.h
+++ b/querymodel.h
@@ -55,7 +55,7 @@ namespace Nepomuk {
     public Q_SLOTS:
         void setQuery( const QString& query );
         void stopQuery();
-
+        bool checkStatus();
     private Q_SLOTS:
         void slotNextResultReady( Soprano::Util::AsyncQuery* query );
         void slotQueryFinished( Soprano::Util::AsyncQuery* );
diff --git a/resourcequerywidget.cpp b/resourcequerywidget.cpp
index 79876eb..ed632bf 100644
--- a/resourcequerywidget.cpp
+++ b/resourcequerywidget.cpp
@@ -69,6 +69,9 @@ ResourceQueryWidget::ResourceQueryWidget( QWidget* parent )
     m_buttonForward->setEnabled( false );
     m_buttonBack->setEnabled( false );
 
+    if(m_queryModel->checkStatus())
+        m_stopQueryButton->setEnabled(false);
+
     // the empty string representing the current query
     m_queryHistory << QString();
 }
@@ -78,7 +81,6 @@ ResourceQueryWidget::~ResourceQueryWidget()
 {
 }
 
-
 QStringList ResourceQueryWidget::queryHistory() const
 {
     // do not return the non-executed query, ie. the last element in the list
diff --git a/resourcequerywidget.h b/resourcequerywidget.h
index a91e41b..22224fc 100644
--- a/resourcequerywidget.h
+++ b/resourcequerywidget.h
@@ -64,6 +64,7 @@ private Q_SLOTS:
     void slotQueryError( const Soprano::Error::Error & error );
     void slotQueryFinished();
     void slotQueryShortenButtonClicked();
+
 private:
     void updateHistoryButtonStates();
 
_______________________________________________
Nepomuk mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/nepomuk

Reply via email to