Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 444 |
1 files changed, 224 insertions, 220 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 132b5a6..6f65c48 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp @@ -30,8 +30,3 @@ -#include <qdatetime.h> -#include <qmap.h> -#include <qstring.h> - -#include <qpe/global.h> - +/* OPIE */ #include <opie2/osqldriver.h> @@ -45,2 +40,11 @@ #include <opie2/opimrecurrence.h> +#include <opie2/odebug.h> + +#include <qpe/global.h> + +/* QT */ +#include <qdatetime.h> +#include <qmap.h> +#include <qstring.h> + @@ -153,17 +157,17 @@ namespace { - /** - * a find query for custom elements - */ - class FindCustomQuery : public OSQLQuery { - public: - FindCustomQuery(int uid); - FindCustomQuery(const QArray<int>& ); - ~FindCustomQuery(); - QString query()const; - private: - QString single()const; - QString multi()const; - QArray<int> m_uids; - int m_uid; - }; + /** + * a find query for custom elements + */ + class FindCustomQuery : public OSQLQuery { + public: + FindCustomQuery(int uid); + FindCustomQuery(const QArray<int>& ); + ~FindCustomQuery(); + QString query()const; + private: + QString single()const; + QString multi()const; + QArray<int> m_uids; + int m_uid; + }; @@ -177,6 +181,6 @@ namespace { qu += "description, summary, priority, DueDate, progress , state, "; - // This is the recurrance-stuff .. Exceptions are currently not supported (see OPimRecurrence.cpp) ! (eilers) - qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, "; - qu += "reminders, alarms, maintainer, startdate, completeddate);"; - qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; + // This is the recurrance-stuff .. Exceptions are currently not supported (see OPimRecurrence.cpp) ! (eilers) + qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, "; + qu += "reminders, alarms, maintainer, startdate, completeddate);"; + qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; return qu; @@ -188,3 +192,3 @@ namespace { QString qu; - // We do not need "distinct" here. The primary key is always unique.. + // We do not need "distinct" here. The primary key is always unique.. //qu += "select distinct uid from todolist"; @@ -215,81 +219,81 @@ namespace { day = date.day(); - } - int sYear = 0, sMonth = 0, sDay = 0; - if( m_todo.hasStartDate() ){ - QDate sDate = m_todo.startDate(); - sYear = sDate.year(); - sMonth= sDate.month(); - sDay = sDate.day(); - } - - int eYear = 0, eMonth = 0, eDay = 0; - if( m_todo.hasCompletedDate() ){ - QDate eDate = m_todo.completedDate(); - eYear = eDate.year(); - eMonth= eDate.month(); - eDay = eDate.day(); - } + } + int sYear = 0, sMonth = 0, sDay = 0; + if( m_todo.hasStartDate() ){ + QDate sDate = m_todo.startDate(); + sYear = sDate.year(); + sMonth= sDate.month(); + sDay = sDate.day(); + } + + int eYear = 0, eMonth = 0, eDay = 0; + if( m_todo.hasCompletedDate() ){ + QDate eDate = m_todo.completedDate(); + eYear = eDate.year(); + eMonth= eDate.month(); + eDay = eDate.day(); + } QString qu; - QMap<int, QString> recMap = m_todo.recurrence().toMap(); + QMap<int, QString> recMap = m_todo.recurrence().toMap(); qu = "insert into todolist VALUES(" - + QString::number( m_todo.uid() ) + "," - + "'" + m_todo.idsToString( m_todo.categories() ) + "'" + "," - + QString::number( m_todo.isCompleted() ) + "," - + "'" + m_todo.description() + "'" + "," - + "'" + m_todo.summary() + "'" + "," - + QString::number(m_todo.priority() ) + "," - + "'" + QString::number(year).rightJustify( 4, '0' ) + "-" - + QString::number(month).rightJustify( 2, '0' ) - + "-" + QString::number( day ).rightJustify( 2, '0' )+ "'" + "," - + QString::number( m_todo.progress() ) + "," - + QString::number( m_todo.state().state() ) + "," - + "'" + recMap[ OPimRecurrence::RType ] + "'" + "," - + "'" + recMap[ OPimRecurrence::RWeekdays ] + "'" + "," - + "'" + recMap[ OPimRecurrence::RPosition ] + "'" + "," - + "'" + recMap[ OPimRecurrence::RFreq ] + "'" + "," - + "'" + recMap[ OPimRecurrence::RHasEndDate ] + "'" + "," - + "'" + recMap[ OPimRecurrence::EndDate ] + "'" + "," - + "'" + recMap[ OPimRecurrence::Created ] + "'" + "," - + "'" + recMap[ OPimRecurrence::Exceptions ] + "'" + ","; - - if ( m_todo.hasNotifiers() ) { - OPimNotifyManager manager = m_todo.notifiers(); - qu += "'" + manager.remindersToString() + "'" + "," - + "'" + manager.alarmsToString() + "'" + ","; - } - else{ - qu += QString( "''" ) + "," - + "''" + ","; - } - - qu += QString( "''" ) + QString( "," ) // Maintainers (cur. not supported !) - + "'" + QString::number(sYear).rightJustify( 4, '0' ) + "-" - + QString::number(sMonth).rightJustify( 2, '0' ) - + "-" + QString::number(sDay).rightJustify( 2, '0' )+ "'" + "," - + "'" + QString::number(eYear).rightJustify( 4, '0' ) + "-" - + QString::number(eMonth).rightJustify( 2, '0' ) - + "-"+QString::number(eDay).rightJustify( 2, '0' ) + "'" - + "); "; - - // Save custom Entries: - int id = 0; - id = 0; - QMap<QString, QString> customMap = m_todo.toExtraMap(); - for( QMap<QString, QString>::Iterator it = customMap.begin(); - it != customMap.end(); ++it ){ - qu += "insert into custom_data VALUES(" - + QString::number( m_todo.uid() ) - + "," - + QString::number( id++ ) - + ",'" - + it.key() - + "'," - + "0" // Priority for future enhancements - + ",'" - + it.data() - + "');"; - } - - - qDebug("add %s", qu.latin1() ); + + QString::number( m_todo.uid() ) + "," + + "'" + m_todo.idsToString( m_todo.categories() ) + "'" + "," + + QString::number( m_todo.isCompleted() ) + "," + + "'" + m_todo.description() + "'" + "," + + "'" + m_todo.summary() + "'" + "," + + QString::number(m_todo.priority() ) + "," + + "'" + QString::number(year).rightJustify( 4, '0' ) + "-" + + QString::number(month).rightJustify( 2, '0' ) + + "-" + QString::number( day ).rightJustify( 2, '0' )+ "'" + "," + + QString::number( m_todo.progress() ) + "," + + QString::number( m_todo.state().state() ) + "," + + "'" + recMap[ OPimRecurrence::RType ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RWeekdays ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RPosition ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RFreq ] + "'" + "," + + "'" + recMap[ OPimRecurrence::RHasEndDate ] + "'" + "," + + "'" + recMap[ OPimRecurrence::EndDate ] + "'" + "," + + "'" + recMap[ OPimRecurrence::Created ] + "'" + "," + + "'" + recMap[ OPimRecurrence::Exceptions ] + "'" + ","; + + if ( m_todo.hasNotifiers() ) { + OPimNotifyManager manager = m_todo.notifiers(); + qu += "'" + manager.remindersToString() + "'" + "," + + "'" + manager.alarmsToString() + "'" + ","; + } + else{ + qu += QString( "''" ) + "," + + "''" + ","; + } + + qu += QString( "''" ) + QString( "," ) // Maintainers (cur. not supported !) + + "'" + QString::number(sYear).rightJustify( 4, '0' ) + "-" + + QString::number(sMonth).rightJustify( 2, '0' ) + + "-" + QString::number(sDay).rightJustify( 2, '0' )+ "'" + "," + + "'" + QString::number(eYear).rightJustify( 4, '0' ) + "-" + + QString::number(eMonth).rightJustify( 2, '0' ) + + "-"+QString::number(eDay).rightJustify( 2, '0' ) + "'" + + "); "; + + // Save custom Entries: + int id = 0; + id = 0; + QMap<QString, QString> customMap = m_todo.toExtraMap(); + for( QMap<QString, QString>::Iterator it = customMap.begin(); + it != customMap.end(); ++it ){ + qu += "insert into custom_data VALUES(" + + QString::number( m_todo.uid() ) + + "," + + QString::number( id++ ) + + ",'" + + it.key() + + "'," + + "0" // Priority for future enhancements + + ",'" + + it.data() + + "');"; + } + + + odebug << "add " << qu << "" << oendl; return qu; @@ -302,3 +306,3 @@ namespace { QString qu = "DELETE FROM todolist WHERE uid = " + QString::number(m_uid) + " ;"; - qu += "DELETE FROM custom_data WHERE uid = " + QString::number(m_uid); + qu += "DELETE FROM custom_data WHERE uid = " + QString::number(m_uid); return qu; @@ -347,5 +351,5 @@ namespace { str = QString("select uid from todolist where DueDate ='%1-%2-%3'") - .arg( QString::number( date.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( date.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( date.day() ) .rightJustify( 2, '0' ) ); + .arg( QString::number( date.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( date.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( date.day() ) .rightJustify( 2, '0' ) ); @@ -364,8 +368,8 @@ namespace { str = QString("select uid from todolist where ( DueDate >= '%1-%2-%3' AND DueDate <= '%4-%5-%6' ) OR DueDate = '0-0-0' ") - .arg( QString::number( m_start.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( m_start.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_start.day() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_end.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( m_end.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_end.day() ).rightJustify( 2, '0' ) ); + .arg( QString::number( m_start.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( m_start.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_start.day() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_end.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( m_end.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_end.day() ).rightJustify( 2, '0' ) ); return str; @@ -375,8 +379,8 @@ namespace { str = QString("select uid from todolist where DueDate >= '%1-%2-%3' AND DueDate <= '%4-%5-%6'") - .arg( QString::number( m_start.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( m_start.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_start.day() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_end.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( m_end.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( m_end.day() ).rightJustify( 2, '0' ) ); + .arg( QString::number( m_start.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( m_start.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_start.day() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_end.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( m_end.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( m_end.day() ).rightJustify( 2, '0' ) ); @@ -385,18 +389,18 @@ namespace { - FindCustomQuery::FindCustomQuery(int uid) - : OSQLQuery(), m_uid( uid ) { - } - FindCustomQuery::FindCustomQuery(const QArray<int>& ints) - : OSQLQuery(), m_uids( ints ){ - } - FindCustomQuery::~FindCustomQuery() { - } - QString FindCustomQuery::query()const{ - return single(); // Multiple requests not supported ! - } - QString FindCustomQuery::single()const{ - QString qu = "select uid, type, value from custom_data where uid = "; - qu += QString::number(m_uid); - return qu; - } + FindCustomQuery::FindCustomQuery(int uid) + : OSQLQuery(), m_uid( uid ) { + } + FindCustomQuery::FindCustomQuery(const QArray<int>& ints) + : OSQLQuery(), m_uids( ints ){ + } + FindCustomQuery::~FindCustomQuery() { + } + QString FindCustomQuery::query()const{ + return single(); // Multiple requests not supported ! + } + QString FindCustomQuery::single()const{ + QString qu = "select uid, type, value from custom_data where uid = "; + qu += QString::number(m_uid); + return qu; + } @@ -407,3 +411,3 @@ namespace Opie { OPimTodoAccessBackendSQL::OPimTodoAccessBackendSQL( const QString& file ) - : OPimTodoAccessBackend(),/* m_dict(15),*/ m_driver(NULL), m_dirty(true) + : OPimTodoAccessBackend(),/* m_dict(15),*/ m_driver(NULL), m_dirty(true) { @@ -419,4 +423,4 @@ OPimTodoAccessBackendSQL::OPimTodoAccessBackendSQL( const QString& file ) OPimTodoAccessBackendSQL::~OPimTodoAccessBackendSQL(){ - if( m_driver ) - delete m_driver; + if( m_driver ) + delete m_driver; } @@ -458,3 +462,3 @@ OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, uint CACHE = readAhead(); - qDebug("searching for %d", uid ); + odebug << "searching for " << uid << "" << oendl; QArray<int> search( CACHE ); @@ -468,3 +472,3 @@ OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, for (uint i = cur; i < ints.count() && size < CACHE; i++ ) { - qDebug("size %d %d", size, ints[i] ); + odebug << "size " << size << " " << ints[i] << "" << oendl; search[size] = ints[i]; @@ -543,3 +547,3 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, int sortFilter, int cat ) { - qDebug("sorted %d, %d", asc, sortOrder ); + odebug << "sorted " << asc << ", " << sortOrder << "" << oendl; QString query; @@ -565,5 +569,5 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, base = QString("DueDate <= '%1-%2-%3' AND completed = 0") - .arg( QString::number( date.year() ).rightJustify( 4, '0' ) ) - .arg( QString::number( date.month() ).rightJustify( 2, '0' ) ) - .arg( QString::number( date.day() ).rightJustify( 2, '0' ) ); + .arg( QString::number( date.year() ).rightJustify( 4, '0' ) ) + .arg( QString::number( date.month() ).rightJustify( 2, '0' ) ) + .arg( QString::number( date.day() ).rightJustify( 2, '0' ) ); query += " " + base + " AND"; @@ -602,3 +606,3 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, if ( !asc ) { - qDebug("not ascending!"); + odebug << "not ascending!" << oendl; query += " DESC"; @@ -606,3 +610,3 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder, - qDebug( query ); + odebug << query << oendl; OSQLRawQuery raw(query ); @@ -631,3 +635,3 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{ OSQLResultItem::ValueList::Iterator it = list.begin(); - qDebug("todo1"); + odebug << "todo1" << oendl; OPimTodo to = todo( (*it) ); @@ -637,3 +641,3 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{ for ( ; it != list.end(); ++it ) { - qDebug("caching"); + odebug << "caching" << oendl; cache( todo( (*it) ) ); @@ -643,3 +647,3 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { - qDebug("todo(ResultItem)"); + odebug << "todo(ResultItem)" << oendl; @@ -651,3 +655,3 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { - qDebug("Item is completed: %d", item.data("completed").toInt() ); + odebug << "Item is completed: " << item.data("completed").toInt() << "" << oendl; @@ -661,3 +665,3 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { if ( isOk ) - to.setPriority( prioInt ); + to.setPriority( prioInt ); @@ -669,5 +673,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const { if ( hasStartDate ) - to.setStartDate( startDate ); + to.setStartDate( startDate ); if ( hasCompletedDate ) - to.setCompletedDate( completedDate ); + to.setCompletedDate( completedDate ); @@ -752,3 +756,3 @@ QArray<int> OPimTodoAccessBackendSQL::uids( const OSQLResult& res) const{ QArray<int> ints(list.count() ); - qDebug(" count = %d", list.count() ); + odebug << " count = " << list.count() << "" << oendl; @@ -766,20 +770,20 @@ QArray<int> OPimTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const #if 0 - QArray<int> empty; - return empty; + QArray<int> empty; + return empty; #else - QString qu = "SELECT uid FROM todolist WHERE ("; + QString qu = "SELECT uid FROM todolist WHERE ("; - // Do it make sense to search other fields, too ? - qu += " rlike(\""+ r.pattern() + "\",\"description\") OR"; - qu += " rlike(\""+ r.pattern() + "\",\"summary\")"; + // Do it make sense to search other fields, too ? + qu += " rlike(\""+ r.pattern() + "\",\"description\") OR"; + qu += " rlike(\""+ r.pattern() + "\",\"summary\")"; - qu += ")"; + qu += ")"; - qDebug( "query: %s", qu.latin1() ); + odebug << "query: " << qu << "" << oendl; - OSQLRawQuery raw( qu ); - OSQLResult res = m_driver->query( &raw ); + OSQLRawQuery raw( qu ); + OSQLResult res = m_driver->query( &raw ); - return uids( res ); + return uids( res ); @@ -791,3 +795,3 @@ QBitArray OPimTodoAccessBackendSQL::supports()const { - return sup(); + return sup(); } @@ -796,11 +800,11 @@ QBitArray OPimTodoAccessBackendSQL::sup() const{ - QBitArray ar( OPimTodo::CompletedDate + 1 ); - ar.fill( true ); - ar[OPimTodo::CrossReference] = false; - ar[OPimTodo::State ] = false; - ar[OPimTodo::Reminders] = false; - ar[OPimTodo::Notifiers] = false; - ar[OPimTodo::Maintainer] = false; + QBitArray ar( OPimTodo::CompletedDate + 1 ); + ar.fill( true ); + ar[OPimTodo::CrossReference] = false; + ar[OPimTodo::State ] = false; + ar[OPimTodo::Reminders] = false; + ar[OPimTodo::Notifiers] = false; + ar[OPimTodo::Maintainer] = false; - return ar; + return ar; } @@ -808,45 +812,45 @@ QBitArray OPimTodoAccessBackendSQL::sup() const{ void OPimTodoAccessBackendSQL::removeAllCompleted(){ - // First we need the uids from all entries which are - // completed. Then, we just have to remove them... + // First we need the uids from all entries which are + // completed. Then, we just have to remove them... - QString qu = "SELECT uid FROM todolist WHERE completed = 1"; + QString qu = "SELECT uid FROM todolist WHERE completed = 1"; - OSQLRawQuery raw( qu ); - OSQLResult res = m_driver->query( &raw ); + OSQLRawQuery raw( qu ); + OSQLResult res = m_driver->query( &raw ); - QArray<int> completed_uids = uids( res ); + QArray<int> completed_uids = uids( res ); - qDebug( "Number of completed: %d", completed_uids.size() ); + odebug << "Number of completed: " << completed_uids.size() << "" << oendl; - if ( completed_uids.size() == 0 ) - return; + if ( completed_uids.size() == 0 ) + return; - qu = "DELETE FROM todolist WHERE ("; - QString query; + qu = "DELETE FROM todolist WHERE ("; + QString query; - for ( int i = 0; i < completed_uids.size(); i++ ){ - if ( !query.isEmpty() ) - query += " OR "; - query += QString( "uid = %1" ).arg( completed_uids[i] ); - } - qu += query + " );"; + for ( int i = 0; i < completed_uids.size(); i++ ){ + if ( !query.isEmpty() ) + query += " OR "; + query += QString( "uid = %1" ).arg( completed_uids[i] ); + } + qu += query + " );"; - // Put remove of custom entries in this query to speed up.. - qu += "DELETE FORM custom_data WHERE ("; - query = ""; + // Put remove of custom entries in this query to speed up.. + qu += "DELETE FORM custom_data WHERE ("; + query = ""; - for ( int i = 0; i < completed_uids.size(); i++ ){ - if ( !query.isEmpty() ) - query += " OR "; - query += QString( "uid = %1" ).arg( completed_uids[i] ); - } - qu += query + " );"; + for ( int i = 0; i < completed_uids.size(); i++ ){ + if ( !query.isEmpty() ) + query += " OR "; + query += QString( "uid = %1" ).arg( completed_uids[i] ); + } + qu += query + " );"; - qDebug( "query: %s", qu.latin1() ); + odebug << "query: " << qu << "" << oendl; - OSQLRawQuery raw2( qu ); - res = m_driver->query( &raw2 ); - if ( res.state() == OSQLResult::Failure ) { - qWarning("OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: %s", qu.latin1() ); - } + OSQLRawQuery raw2( qu ); + res = m_driver->query( &raw2 ); + if ( res.state() == OSQLResult::Failure ) { + owarn << "OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: " << qu << "" << oendl; + } } @@ -856,20 +860,20 @@ QMap<QString, QString> OPimTodoAccessBackendSQL::requestCustom( int uid ) const { - QMap<QString, QString> customMap; + QMap<QString, QString> customMap; - FindCustomQuery query( uid ); - OSQLResult res_custom = m_driver->query( &query ); + FindCustomQuery query( uid ); + OSQLResult res_custom = m_driver->query( &query ); - if ( res_custom.state() == OSQLResult::Failure ) { - qWarning("OSQLResult::Failure in find query !!"); - QMap<QString, QString> empty; - return empty; - } + if ( res_custom.state() == OSQLResult::Failure ) { + owarn << "OSQLResult::Failure in find query !!" << oendl; + QMap<QString, QString> empty; + return empty; + } - OSQLResultItem::ValueList list = res_custom.results(); - OSQLResultItem::ValueList::Iterator it = list.begin(); - for ( ; it != list.end(); ++it ) { - customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); - } + OSQLResultItem::ValueList list = res_custom.results(); + OSQLResultItem::ValueList::Iterator it = list.begin(); + for ( ; it != list.end(); ++it ) { + customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); + } - return customMap; + return customMap; } |