Mercurial > hg > easaier-soundaccess
changeset 280:8bdfbd9ad418
return to the old result list.
author | benoitrigolleau |
---|---|
date | Fri, 31 Oct 2008 10:01:25 +0000 |
parents | 427272bfec3b |
children | 97f2289c5b68 |
files | data/fileio/FileParserThread.cpp data/fileio/FileParserThread.h data/fileio/SparqlResultsReader.cpp data/fileio/SparqlResultsReader.h data/svdata.vcproj sv/filter/TimeStretchFilter.cpp sv/filter/TimeStretchFilter.h sv/main/EasaierSessionManager.cpp sv/main/MainWindow.cpp widgets/QueryResultsWidget.cpp widgets/QueryResultsWidget.h |
diffstat | 11 files changed, 248 insertions(+), 195 deletions(-) [+] |
line wrap: on
line diff
--- a/data/fileio/FileParserThread.cpp Tue Oct 21 15:17:16 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#include "FileParserThread.h" - -#include "data/fileio/SparqlResultsReader.h" -#include "data/fileio/SparqlRelatedMediaReader.h" -#include "main/MainWindow.h" -#include "widgets/QueryResultsWidget.h" - - -FileParserThread::FileParserThread(QString filename,QObject* parent):QThread(parent){ - m_filename = filename; -} - -void FileParserThread::run(){ - QueryResultsWidget* resultsWidget = MainWindow::instance()->getQueryResultsWidget(); - resultsWidget->reset(); - - if (resultsWidget) - { - SparqlResultsReader rd; - connect(rd.getHandler(), SIGNAL(newResultDetected ()), MainWindow::instance(),SLOT(createNewResultItem()),Qt::QueuedConnection); - connect(rd.getHandler(), SIGNAL(newInfoResultDetected(QString,QString)), MainWindow::instance(),SLOT(addInfoIntoResultItem(QString,QString)),Qt::QueuedConnection); - connect(rd.getHandler(), SIGNAL(endOfResultDetected ()), MainWindow::instance(),SLOT(saveCurrentResultItem()),Qt::QueuedConnection); //Qt::DirectConnection - connect(rd.getHandler(), SIGNAL(endOfDocumentDetected ()), MainWindow::instance(),SLOT(displayResultList()),Qt::QueuedConnection); - - rd.parse(m_filename); - } -} \ No newline at end of file
--- a/data/fileio/FileParserThread.h Tue Oct 21 15:17:16 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* Sound Access - EASAIER client application. - Silogic 2008. Rigolleau Benoit. - - 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) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#ifndef _FILE_PARSER_THREAD_H_ -#define _FILE_PARSER_THREAD_H_ - -#include <QThread> - -class FileParserThread : public QThread -{ - Q_OBJECT -public: - FileParserThread(QString filename,QObject* parent = 0); - -protected: - virtual void run(); -private : - QString m_filename; - -}; - -#endif \ No newline at end of file
--- a/data/fileio/SparqlResultsReader.cpp Tue Oct 21 15:17:16 2008 +0000 +++ b/data/fileio/SparqlResultsReader.cpp Fri Oct 31 10:01:25 2008 +0000 @@ -15,17 +15,16 @@ #include <iostream> -SparqlResultsReader::SparqlResultsReader() -{ - m_handler = new SparqlResultsHandler; -} +SparqlResultsReader::SparqlResultsReader(QueryResultsWidget* resultsWidget) : + m_resultsWidget(resultsWidget) +{} bool SparqlResultsReader::parse(const QString & filename) { + SparqlResultsHandler handler(m_resultsWidget); QXmlSimpleReader reader; - - reader.setContentHandler(m_handler); - reader.setErrorHandler(m_handler); + reader.setContentHandler(&handler); + reader.setErrorHandler(&handler); QFile file(filename); @@ -36,13 +35,143 @@ QXmlInputSource xmlInputSource(&file); if (reader.parse(xmlInputSource)) { + m_resultsWidget->displayResult(); return true; } return false; } -SparqlResultsHandler* SparqlResultsReader::getHandler(){ - return m_handler; +SparqlResultsHandler::SparqlResultsHandler(QueryResultsWidget* resultsWidget) : QXmlDefaultHandler(), + m_resultsWidget(resultsWidget), + m_inBinding(false), + m_curBindingName("") +{} + +bool SparqlResultsHandler::startElement(const QString &namespaceURI, const QString &localName, + const QString &qName, const QXmlAttributes &attributes) +{ + + QString name = qName.toLower(); + + bool ok = false; + + // Valid element names: + // + // sparql + // head + // variable + // results + // result + // binding + + if (name == "sparql") { + + // nothing needed + ok = true; + + } else if (name == "head") { + + // nothing needed + ok = true; + + } else if (name == "variable") { + + // nothing needed + ok = true; + + } else if (name == "results") { + + // nothing needed + ok = true; + + } else if (name == "result") { + + m_resultsWidget->newResult(); + ok = true; + + } else if (name == "binding") { + + m_curBindingName = attributes.value("name"); + ok = true; + + } else if ( (name == "uri") || (name == "literal") ) { + m_inBinding = true; + ok = true; + } + + if (!ok) { + std::cerr << "WARNING: SparqlResultsHandler-XML: Failed to completely process element \"" + << name.toLocal8Bit().data() << "\"" << std::endl; + } + + return true; } +bool SparqlResultsHandler::endElement(const QString &namespaceURI, const QString &localName, + const QString &qName) +{ + QString name = qName.toLower(); + + if ( (name == "uri") || (name == "literal") ) + { + m_inBinding = false; + m_curBindingName = ""; + + } else if (name == "result") + { + /*m_resultsWidget->addInfo("composer", m_composer); + m_resultsWidget->addInfo("arranger", m_arranger); + m_composer.clear(); + m_arranger.clear(); + m_composer.append(" -"); + m_arranger.append(" -");*/ + + m_resultsWidget->saveCurResult(); + } + + return true; +} + +bool SparqlResultsHandler::characters(const QString &str) +{ + if (m_inBinding) + { + /*if (m_curBindingName.contains("composer")) + { + m_composer.append(" " + str); + } + else if (m_curBindingName.contains("arranger")) + { + m_arranger.append(" " + str); + } + else + {*/ + m_resultsWidget->addInfo(m_curBindingName, str); + //} + } + + return true; +} + +bool SparqlResultsHandler::error(const QXmlParseException &exception) +{ + QString errorString; + errorString += QString("ERROR: SparqlResultsHandler-XML: %1 at line %2, column %3") + .arg(exception.message()) + .arg(exception.lineNumber()) + .arg(exception.columnNumber()); + std::cerr << errorString.toLocal8Bit().data() << std::endl; + return QXmlDefaultHandler::error(exception); +} + +bool SparqlResultsHandler::fatalError(const QXmlParseException &exception) +{ + QString errorString; + errorString += QString("FATAL ERROR: SparqlResultsHandler-XML: %1 at line %2, column %3") + .arg(exception.message()) + .arg(exception.lineNumber()) + .arg(exception.columnNumber()); + std::cerr << errorString.toLocal8Bit().data() << std::endl; + return QXmlDefaultHandler::fatalError(exception); +}
--- a/data/fileio/SparqlResultsReader.h Tue Oct 21 15:17:16 2008 +0000 +++ b/data/fileio/SparqlResultsReader.h Fri Oct 31 10:01:25 2008 +0000 @@ -15,21 +15,45 @@ #define _SPARQL_RESULTS_READER_H_ #include <QXmlDefaultHandler> -#include "SparqlResultsHandler.h" + +#include "widgets/QueryResultsWidget.h" class SparqlResultsReader { public: - SparqlResultsReader(); + SparqlResultsReader(QueryResultsWidget* resultsWidget); virtual ~SparqlResultsReader(){} bool parse(const QString & filename); - - SparqlResultsHandler* getHandler(); -protected : - SparqlResultsHandler* m_handler; +private: + + QueryResultsWidget *m_resultsWidget; }; +class SparqlResultsHandler : public QXmlDefaultHandler +{ +public: + SparqlResultsHandler(QueryResultsWidget* resultsWidget); + + bool startElement(const QString &namespaceURI, const QString &localName, + const QString &qName, const QXmlAttributes &attributes); + bool endElement(const QString &namespaceURI, const QString &localName, + const QString &qName); + bool characters(const QString &str); + bool error(const QXmlParseException &exception); + bool fatalError(const QXmlParseException &exception); + + +private: + + QueryResultsWidget *m_resultsWidget; + + bool m_inBinding; + QString m_curBindingName; + + QString m_composer; + QString m_arranger; +}; #endif
--- a/data/svdata.vcproj Tue Oct 21 15:17:16 2008 +0000 +++ b/data/svdata.vcproj Fri Oct 31 10:01:25 2008 +0000 @@ -320,10 +320,6 @@ > </File> <File - RelativePath=".\fileio\FileParserThread.cpp" - > - </File> - <File RelativePath="fileio\FileReadThread.cpp" > </File> @@ -922,43 +918,6 @@ </FileConfiguration> </File> <File - RelativePath=".\fileio\FileParserThread.h" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DNDEBUG -DBUILD_RELEASE -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" - AdditionalDependencies="$(QTDIR)\bin\moc.exe" - Outputs="tmp_moc\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" - AdditionalDependencies="$(QTDIR)\bin\moc.exe" - Outputs="tmp_moc\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Static_Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DNDEBUG -DBUILD_RELEASE -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_STATIC -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" - AdditionalDependencies="$(QTDIR)\bin\moc.exe" - Outputs="tmp_moc\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File RelativePath=".\fileio\FileReadThread.h" > <FileConfiguration @@ -1337,7 +1296,7 @@ <Tool Name="VCCustomBuildTool" Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" + CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp
" AdditionalDependencies="$(QTDIR)\bin\moc.exe" Outputs="tmp_moc\moc_$(InputName).cpp" /> @@ -1460,10 +1419,6 @@ > </File> <File - RelativePath=".\tmp_moc\moc_FileParserThread.cpp" - > - </File> - <File RelativePath="tmp_moc\moc_FileReadThread.cpp" > </File>
--- a/sv/filter/TimeStretchFilter.cpp Tue Oct 21 15:17:16 2008 +0000 +++ b/sv/filter/TimeStretchFilter.cpp Fri Oct 31 10:01:25 2008 +0000 @@ -29,6 +29,8 @@ float hopfactor = 1; +bool freeze; + TimeStretchFilter::TimeStretchFilter() : PropertyContainer(), m_transcheck(true), @@ -39,7 +41,7 @@ m_pmaxfactor(2) { setObjectName("Pitch-Time Stretching"); - +freeze = false; setFilterEnabled(false); connect(this, SIGNAL(playSpeedChanged(float)), @@ -169,6 +171,7 @@ } else if (name == "Peaklock"){ m_peakcheck = (value > 0) ? true : false; } else if (name == "TimeFreeze"){ + freeze = (value > 0) ? true : false; m_freezecheck = (value > 0) ? true : false; } #ifdef DEBUG_FILTERS
--- a/sv/filter/TimeStretchFilter.h Tue Oct 21 15:17:16 2008 +0000 +++ b/sv/filter/TimeStretchFilter.h Fri Oct 31 10:01:25 2008 +0000 @@ -21,6 +21,11 @@ #include "base/PropertyContainer.h" +/*Hot Fixe*/ +extern bool freeze; +/**********/ + + class TimeStretchFilter : public PropertyContainer { Q_OBJECT
--- a/sv/main/EasaierSessionManager.cpp Tue Oct 21 15:17:16 2008 +0000 +++ b/sv/main/EasaierSessionManager.cpp Fri Oct 31 10:01:25 2008 +0000 @@ -43,8 +43,6 @@ #include "widgets/SpeechFileHandler.h" #include <QMessageBox> -#include "data/fileio/FileParserThread.h" - EasaierSessionManager::EasaierSessionManager(HttpClient* httpClient) : QObject(), m_fileName(""), m_httpClient(httpClient), @@ -349,22 +347,14 @@ } case LoadedFile::QUERY_RESULTS : { - /*QueryResultsWidget* resultsWidget = MainWindow::instance()->getQueryResultsWidget(); + QueryResultsWidget* resultsWidget = MainWindow::instance()->getQueryResultsWidget(); resultsWidget->reset(); if (resultsWidget) { - SparqlResultsReader rd; - connect(rd.getHandler(), SIGNAL(newResultDetected ()), MainWindow::instance(),SLOT(createNewResultItem()),Qt::QueuedConnection); - connect(rd.getHandler(), SIGNAL(newInfoResultDetected(QString,QString)), MainWindow::instance(),SLOT(addInfoIntoResultItem(QString,QString)),Qt::QueuedConnection); - connect(rd.getHandler(), SIGNAL(endOfResultDetected ()), MainWindow::instance(),SLOT(saveCurrentResultItem()),Qt::QueuedConnection); //Qt::DirectConnection - connect(rd.getHandler(), SIGNAL(endOfDocumentDetected ()), MainWindow::instance(),SLOT(displayResultList()),Qt::QueuedConnection); - - read = rd.parse(filename); - }*/ - FileParserThread *myThread = new FileParserThread(filename); - myThread->start(); - read = true; + SparqlResultsReader reader(resultsWidget); + read = reader.parse(filename); + } break; } case LoadedFile::RELATED_MEDIA_LIST : @@ -659,4 +649,5 @@ QApplication::setOverrideCursor( Qt::WaitCursor ); loadFile(*payload, filename, LoadedFile::VOCAL_QUERY, postFilePath); + } \ No newline at end of file
--- a/sv/main/MainWindow.cpp Tue Oct 21 15:17:16 2008 +0000 +++ b/sv/main/MainWindow.cpp Fri Oct 31 10:01:25 2008 +0000 @@ -110,6 +110,10 @@ #include <cstdio> #include <errno.h> +/*HOT FIXE*/ +#include "TimeStretchFilter.h" +/**********/ + using std::cerr; using std::endl; @@ -3647,7 +3651,7 @@ { unsigned long pos = 0; unsigned long newAudioTime=m_viewManager->getPlaybackFrame()/(getMainModel()->getSampleRate()/1000); - if(!(m_playSource->lastAudioTime==newAudioTime)) + if(!(m_playSource->lastAudioTime==newAudioTime) || freeze) { m_playSource->lastAudioTime=newAudioTime; long long cntClick = 0;
--- a/widgets/QueryResultsWidget.cpp Tue Oct 21 15:17:16 2008 +0000 +++ b/widgets/QueryResultsWidget.cpp Fri Oct 31 10:01:25 2008 +0000 @@ -21,11 +21,8 @@ #include "sv/main/MainWindow.h" -#include <windows.h> - int rank = 1; - QueryResultsWidget::QueryResultsWidget() : QWidget(), m_currentRow(0) { @@ -44,8 +41,6 @@ mainLayout->addWidget(m_scrollArea); setLayout(mainLayout); - - connect(this,SIGNAL(pleaseAddResult(QString,QString,QString,int,QString)),this,SLOT(addResultWidget(QString,QString,QString,int,QString))); } QueryResultsWidget::~QueryResultsWidget() @@ -111,55 +106,66 @@ void QueryResultsWidget::saveCurResult() { - //m_currentRow = 0; - int type = 0; + m_allresults.push_back(m_curResult); + m_curResult = new std::vector<Info>; - std::vector<Info>::iterator iterOnInfo; - QString author = ""; - QString title = ""; - QString uri = ""; - QString confidence = "1"; - - for (iterOnInfo = (*m_curResult).begin(); iterOnInfo != (*m_curResult).end(); iterOnInfo++) - { - if ((*iterOnInfo).name == "signal") - { - uri = (*iterOnInfo).value; - //uri = uri.right(uri.length() - uri.lastIndexOf("#") - 1); - } - } - - for (iterOnInfo = (*m_curResult).begin(); iterOnInfo != (*m_curResult).end(); iterOnInfo++) - { - if ((*iterOnInfo).name != "signal") - { - //if((*iterOnInfo).name == "composer"){ - if((*iterOnInfo).name == "author"){ - author = (*iterOnInfo).value; - } - //if ((*iterOnInfo).name == "performance_title") - if ((*iterOnInfo).name == "title") - { - title += (*iterOnInfo).value; - } - if ((*iterOnInfo).name == "confidence") - { - confidence = (*iterOnInfo).value; - } - } - } - - //Sleep(5000); - //emit pleaseAddResult(author,title,uri,type,confidence); - addResultWidget(author,title,uri,type,confidence); - - m_currentRow=m_currentRow+3; - rank++; - m_curResult = new std::vector<Info>; } void QueryResultsWidget::displayResult() { + m_currentRow = 0; + rank = 1; + addTop(); + int type = 0; + + std::vector<std::vector<Info>*>::iterator iterOnResults; + int size = m_allresults.size(); + + for (iterOnResults = m_allresults.begin(); iterOnResults != m_allresults.end();iterOnResults++) + { + std::vector<Info>* onInfo = *iterOnResults; + std::vector<Info>::iterator iterOnInfo; + QString author = ""; + QString title = ""; + QString uri = ""; + QString confidence = "1"; + + for (iterOnInfo = (*onInfo).begin(); iterOnInfo != (*onInfo).end(); iterOnInfo++) + { + if ((*iterOnInfo).name == "signal") + { + uri = (*iterOnInfo).value; + //uri = uri.right(uri.length() - uri.lastIndexOf("#") - 1); + } + } + + for (iterOnInfo = (*onInfo).begin(); iterOnInfo != (*onInfo).end(); iterOnInfo++) + { + if ((*iterOnInfo).name != "signal") + { + //if((*iterOnInfo).name == "composer"){ + if((*iterOnInfo).name == "author"){ + author = (*iterOnInfo).value; + } + //if ((*iterOnInfo).name == "performance_title") + if ((*iterOnInfo).name == "title") + { + title += (*iterOnInfo).value; + } + if ((*iterOnInfo).name == "confidence") + { + confidence = (*iterOnInfo).value; + } + } + } + if (author == "Django") + type = 2; + addResultWidget(author,title,uri,type,confidence); + m_currentRow=m_currentRow+3; + rank++; + + } + addFoot(); } @@ -174,7 +180,7 @@ //add the type QLabel *labelIcon = new QLabel(); labelIcon->setMaximumWidth(25); - labelIcon->setMinimumWidth(25);// + labelIcon->setMinimumWidth(25); QString pixmapName; switch(type){ case 0: @@ -268,7 +274,6 @@ hLine->setMinimumHeight(1); m_resultsLayout->setRowMinimumHeight(m_currentRow+2,1); m_resultsLayout->addWidget(hLine,m_currentRow+2,1,1,12); - }
--- a/widgets/QueryResultsWidget.h Tue Oct 21 15:17:16 2008 +0000 +++ b/widgets/QueryResultsWidget.h Fri Oct 31 10:01:25 2008 +0000 @@ -34,18 +34,13 @@ void reset(); -signals : - void pleaseAddResult(QString,QString,QString,int,QString); - -protected slots : - void addResultWidget(QString author,QString title, QString uri, int type, QString confidence); - - protected: void addTop(); void addFoot(); - + void addResultWidget(QString author,QString title, QString uri, int type, QString confidence); + + QScrollArea * m_scrollArea; QGridLayout *m_resultsLayout; @@ -61,4 +56,5 @@ }; + #endif \ No newline at end of file