I realized my mistake, i have solved the problem all thanks to trueg and
vHanda, this patch works for me for 2-3 queries i tried but you can check
out for anymore
- Smit Shah (my real name for future references.)
diff --git a/querymodel.cpp b/querymodel.cpp
index d78a865..4a1d0bb 100644
--- a/querymodel.cpp
+++ b/querymodel.cpp
@@ -273,6 +273,6 @@ void Nepomuk::QueryModel::stopQuery()
d->m_currentQuery = 0;
}
+#include "querymodel.moc"
-#include "querymodel.moc"
diff --git a/querymodel.h b/querymodel.h
index 698dfee..ab37aa0 100644
--- a/querymodel.h
+++ b/querymodel.h
@@ -55,7 +55,7 @@ namespace Nepomuk {
public Q_SLOTS:
void setQuery( const QString& query );
void stopQuery();
-
+
private Q_SLOTS:
void slotNextResultReady( Soprano::Util::AsyncQuery* query );
void slotQueryFinished( Soprano::Util::AsyncQuery* );
diff --git a/resourcequerywidget.cpp b/resourcequerywidget.cpp
index 79876eb..b34932d 100644
--- a/resourcequerywidget.cpp
+++ b/resourcequerywidget.cpp
@@ -1,19 +1,4 @@
/*
- Copyright (c) 2010 Sebastian Trueg <[email protected]>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License or (at your option) version 3 or any later version
- accepted by the membership of KDE e.V. (or its successor approved
- by the membership of KDE e.V.), which shall act as a proxy
- defined in Section 14 of version 3 of the license.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -38,7 +23,7 @@
ResourceQueryWidget::ResourceQueryWidget( QWidget* parent )
: QWidget( parent ),
- m_queryHistoryIndex( 0 )
+ m_queryHistoryIndex( 0 )
{
setupUi( this );
@@ -68,6 +53,7 @@ ResourceQueryWidget::ResourceQueryWidget( QWidget* parent )
connect( m_shorten, SIGNAL(clicked()),this,SLOT(slotQueryShortenButtonClicked()));
m_buttonForward->setEnabled( false );
m_buttonBack->setEnabled( false );
+ m_stopQueryButton->setEnabled(false);
// the empty string representing the current query
m_queryHistory << QString();
@@ -78,7 +64,6 @@ ResourceQueryWidget::~ResourceQueryWidget()
{
}
-
QStringList ResourceQueryWidget::queryHistory() const
{
// do not return the non-executed query, ie. the last element in the list
@@ -117,6 +102,7 @@ void ResourceQueryWidget::slotQueryButtonClicked()
m_queryHistory.insert(m_queryHistory.count()-1, m_queryEdit->toPlainText() );
}
m_queryModel->setQuery( query );
+ m_stopQueryButton->setEnabled(true);
updateHistoryButtonStates();
}
@@ -188,11 +174,15 @@ void ResourceQueryWidget::slotQueryError(const Soprano::Error::Error& error)
void ResourceQueryWidget::slotQueryFinished()
{
m_statusLabel->setText( i18n("Elapsed: %1", KGlobal::locale()->formatDuration(m_queryModel->queryTime())) );
+ m_stopQueryButton->setEnabled(false);
+
}
void ResourceQueryWidget::slotQueryStopButtonClicked()
{
m_queryModel->stopQuery();
+ m_stopQueryButton->setEnabled(false);
+
}
void ResourceQueryWidget::slotQueryShortenButtonClicked()
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