From: <ks...@us...> - 2010-03-03 20:49:04
|
Revision: 2068 http://nghost.svn.sourceforge.net/nghost/?rev=2068&view=rev Author: kshots Date: 2010-03-03 20:48:58 +0000 (Wed, 03 Mar 2010) Log Message: ----------- * Fixed the remainder of the header hell issues by fixing basedb.hpp (basedb.hpp was split into basedb.h and basedb.cpp to keep Qt headers out of nghost headers) Modified Paths: -------------- libnghost/src/dao/CMakeLists.txt libnghost/src/dao/GenericListDao.cpp libnghost/src/dao/GenericListDao.h libnghost/src/dao/IListboxDao.h libnghost/src/dao/baseobject.h libnghost/src/dao/desktopdao.cpp libnghost/src/dao/extendedmediadao.cpp libnghost/src/dao/listboxdao.cpp libnghost/src/dao/listboxdao.h libnghost/src/dao/mediadao.cpp libnghost/src/dao/mediadao.h libnghost/src/dao/playerdao.cpp libnghost/src/dao/skindao.cpp libnghost/src/gui2/listbox.cpp libnghost/src/gui2/listbox.h libnghost/src/gui2/nwm.cpp libnghost/src/gui2/screen.cpp Added Paths: ----------- libnghost/src/dao/basedb.cpp libnghost/src/dao/basedb.h Removed Paths: ------------- libnghost/src/dao/basedb.hpp Modified: libnghost/src/dao/CMakeLists.txt =================================================================== --- libnghost/src/dao/CMakeLists.txt 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/CMakeLists.txt 2010-03-03 20:48:58 UTC (rev 2068) @@ -7,12 +7,12 @@ ${SDLIMAGE_INCLUDE_DIR} ${taglib_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) set(dao_headers populate.h dbtables.h playerdao.h baseobject.h - basedb.hpp extendedmediadao.h mediadao.h listboxdao.h + basedb.h extendedmediadao.h mediadao.h listboxdao.h desktopdao.h IListboxDao.h DaoHelper.h GenericListDao.h skindao.h) - set(dao_sources populate.cpp playerdao.cpp extendedmediadao.cpp - mediadao.cpp listboxdao.cpp desktopdao.cpp DaoHelper.cpp - GenericListDao.cpp skindao.cpp) + set(dao_sources basedb.cpp populate.cpp playerdao.cpp + extendedmediadao.cpp mediadao.cpp listboxdao.cpp desktopdao.cpp + DaoHelper.cpp GenericListDao.cpp skindao.cpp) add_library(nghostdao SHARED ${dao_sources}) add_library(nghostdao-static STATIC ${dao_sources}) add_dependencies(nghostdao-static nghostcore nghostlog nghostplugin) Modified: libnghost/src/dao/GenericListDao.cpp =================================================================== --- libnghost/src/dao/GenericListDao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/GenericListDao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -17,12 +17,15 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <QSqlQuery> +#include <QSqlDatabase> +#include <QSqlError> +#include <QVariant> + #include "skindao.h" -#include <basedb.hpp> +#include <basedb.h> #include <string> -#include <QSqlQuery> -#include <QSqlDatabase> #include "dbtables.h" using namespace std; Modified: libnghost/src/dao/GenericListDao.h =================================================================== --- libnghost/src/dao/GenericListDao.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/GenericListDao.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -23,7 +23,7 @@ #include <string> #include <vector> #include "baseobject.h" -#include "basedb.hpp" +#include "basedb.h" #include "IListboxDao.h" Modified: libnghost/src/dao/IListboxDao.h =================================================================== --- libnghost/src/dao/IListboxDao.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/IListboxDao.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -1,7 +1,7 @@ #ifndef _ILISTBOXDAO_H_ #define _ILISTBOXDAO_H_ -#include "basedb.hpp" +#include "basedb.h" namespace nghost { Added: libnghost/src/dao/basedb.cpp =================================================================== --- libnghost/src/dao/basedb.cpp (rev 0) +++ libnghost/src/dao/basedb.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -0,0 +1,189 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include "basedb.h" + +#include <QObject> +#include <QVariantList> +#include <QSqlDatabase> +#include <QSqlQuery> +#include <QSqlError> +#include <cstdlib> + +using namespace nghost; +using namespace std; + +BaseDB::~BaseDB() +{ + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Destroying db object. Table: %s", table.c_str()); +} + +void +BaseDB::setTable(string tablename) +{ + if(tablename == "") return; + table = tablename; + if(!tableExists()) reloadTable(); +} + +void +BaseDB::init(string tablename, string tablestring) +{ + string dbname = getOption("database"); + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Initializing db object. Table: %s",tablename.c_str()); + tableString = tablestring; + + QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); + db.setDatabaseName(dbname.c_str()); + + ndebug::out(ndebug::LOG_INFO, "BaseDB: Using db/db-file: %s",dbname.c_str()); + + if(! db.open()) + { + ndebug::out(ndebug::LOG_ERR, "%s:%s(%d) BaseDB: database not found %s", __FILE__, __FUNCTION__, __LINE__, dbname.c_str()); + exit(1); + } + setTable(tablename); +} + +void +BaseDB::reloadTable() +{ + //printf("BaseDB: reloading table %s",table.c_str()); + //dropTable(); + //createTable(); +} + +bool +BaseDB::tableExists() +{ + bool exists=false; + string query = "SELECT * FROM "+table+" LIMIT 0,1"; + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: checking for existing table with %s",query.c_str()); + QSqlQuery q; + if(!q.exec(query.c_str()) ) + { + ndebug::out(ndebug::LOG_WARNING, "%s:%s(%d) - Error while exec'ing query:\nError: %s", __FILE__, __FUNCTION__, __LINE__, q.lastError().text().toAscii().constData()); + return false; + } + int numrows = q.size(); + if(numrows <= 0 ) + exists = false; + else exists = true; + + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Table '%s' exists? %d because %d rows where found.\n", table.c_str(), exists, numrows); + return exists; +} + +void +BaseDB::renameTable(string newname) +{ + dropTable(newname); + string query = "ALTER TABLE "+table+" RENAME TO "+newname; + QSqlQuery q; + q.exec(query.c_str()); +} + +void +BaseDB::update(NameValuePair<string> param, NameValuePair<string> qualifier) +{ + update<string, string>(param, qualifier); +} + +void +BaseDB::deleteRow(NameValuePair<string> qualifier) +{ + deleteRow<string>(qualifier); +} + +void +BaseDB::deleteRows(string colname, vector<string> values) +{ + ostringstream query; + ostringstream tempval; + QSqlQuery q; + + query << "DELETE FROM "<< table<< " WHERE "<<colname<<" = ?"; + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: %s: %s",__FUNCTION__, query.str().c_str()); + + q.prepare(query.str().c_str()); + + QVariantList vs; + + for(int i=0; (unsigned)i<values.size(); i++) + { + vs<<QString::fromStdString(values[i]); + } + + q.addBindValue(vs); + q.execBatch(); +} + +void +BaseDB::dropTable(string tablename) +{ + string query="DROP TABLE IF EXISTS "+tablename; + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Dropping Table %s with query:? %s",tablename.c_str(),query.c_str()); + QSqlQuery q; + q.exec(query.c_str()); +} + +void +BaseDB::createTable() +{ + string t = tableString; + string query; + string::size_type i=t.find("%s",0); + if(i!=string::npos) query=t.replace(i, 2, table); + else query = t; + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Creating Table %s with query:? %s",table.c_str(),query.c_str()); + QSqlQuery q; + q.exec(query.c_str()); +} + +void +BaseDB::fixFilename(string * filename) +{ + string::size_type i=0; + while(1) + { + i = filename->find(" ",i); + if(i == string::npos) + break; + filename->replace(i,1,"\\ "); + i+=2; + } +} + +void +BaseDB::unfixFilename(string * filename) +{ + string::size_type i=0; + i=filename->find("\\",0); + if(i == string::npos) + return; + else + { + filename->replace(i,1,""); + unfixFilename(filename); + } +} + +void +BaseDB::queryexec(const string & query)const +{ + QSqlQuery().exec(query.c_str()); +} Copied: libnghost/src/dao/basedb.h (from rev 2064, libnghost/src/dao/basedb.hpp) =================================================================== --- libnghost/src/dao/basedb.h (rev 0) +++ libnghost/src/dao/basedb.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -0,0 +1,152 @@ +/* + * timedate - Displays time and date and daily events + * Copyright (c) <2009>, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + * + * You should have received a copy of the GNU Lesser General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef _BASEDB_H_ +#define _BASEDB_H_ + +# include <string> +# include <sstream> +# include <ndebug.h> +# include <vector> +# include <settings.h> + +namespace nghost +{ + class BaseDB + { + public: + BaseDB(){} + virtual ~BaseDB(); + + void setTable(std::string tablename); + virtual void init(std::string tablename, std::string tablestring); + virtual void reloadTable(); + virtual bool tableExists(); + virtual void renameTable(std::string newname); + template<typename T> void insert(DictionaryList<T> params); + template<typename T> void insert(NameValuePair<T> param); + virtual void insert(DictionaryList<std::string> params){insert<std::string>(params);} + template<typename T, typename TT, typename T3> void update(T col, TT colval, NameValuePair<T3> qualifier); + template<typename T, typename TT> void update(NameValuePair<T> param, NameValuePair<TT> qualifier){update<std::string, T, TT>(param.name, param.value, qualifier);} + template<typename T, typename TT> void update(DictionaryList<T> params, NameValuePair<TT> qualifier); + virtual void update(NameValuePair<std::string> param, NameValuePair<std::string> qualifier); + template<typename T> void deleteRow(NameValuePair<T> qualifier); + virtual void deleteRow(NameValuePair<std::string> qualifier); + void deleteRows(std::string colname, std::vector<std::string> values); + virtual void dropTable(){dropTable(table);} + virtual void dropTable(std::string tablename); + virtual void createTable(); + std::string fixInvalids(std::string filename){return filename;} + + protected: + + void fixFilename(std::string* filename); + void unfixFilename(std::string* filename); + + void queryexec(const std::string & query)const; + + std::string table; + std::string tableString; + + }; //BaseDB class + + template<typename T> + inline void + BaseDB::insert(DictionaryList<T> params) + { + std::string query = "INSERT INTO "+table+" ("; + std::ostringstream endquery; + endquery<<" VALUES ( "; + for(size_t i=0; i< params.size(); i++) + { + query+=" `"+fixInvalids(params[i].name)+"`"; + std::ostringstream tempval; + tempval<<params[i].value; + endquery<<"'"<<fixInvalids(tempval.str())<<"'"; + if(i < params.size()-1) + { + query+=","; + endquery<<","; + } + } + endquery<<" )"; + query+=" )"+endquery.str(); + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: %s",query.c_str()); + queryexec(query); + } + + template<typename T> + inline void + BaseDB::insert(NameValuePair<T> param) + { + std::string query = "INSERT INTO "+table+" ("; + std::ostringstream endquery; + endquery<<" VALUES ( "; + query+=" `"+fixInvalids(param.name)+"`"; + std::ostringstream tempval; + tempval<<param.value; + endquery<<"'"<<fixInvalids(tempval.str())<<"'"; + endquery<<" )"; + query+=" )"+endquery.str(); + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: %s",query.c_str()); + queryexec(query); + } + + template<typename T, typename TT, typename T3> + inline void + BaseDB::update(T col, TT colval, NameValuePair<T3> qualifier) + { + std::ostringstream query; + std::ostringstream tempval; + std::ostringstream tempcolval; + tempval<<qualifier.value; + tempcolval<<colval; + query << "UPDATE "<< table << + " SET `"<<col<<"` = '"<<fixInvalids(tempcolval.str())<< + "' WHERE `"<<fixInvalids(qualifier.name)<<"` = '"<<fixInvalids(tempval.str())<<"'"; + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: Update: %s",query.str().c_str()); + queryexec(query.str()); + } + + template <typename T, typename TT> + inline void + BaseDB::update(DictionaryList<T> params, NameValuePair<TT> qualifier) + { + for(size_t i=0;i<params.size();i++) + { + update<T,TT>(params[i],qualifier); + } + } + + template <typename T> + inline void + BaseDB::deleteRow(NameValuePair<T> qualifier) + { + std::ostringstream query; + std::ostringstream tempval; + tempval<<qualifier.value; + query << "DELETE FROM "<< table<< + " WHERE "<<qualifier.name<<" = "<<fixInvalids(tempval.str()); + ndebug::out(ndebug::LOG_DEBUG, "BaseDB: %s: %s",__FUNCTION__, query.str().c_str()); + queryexec(query.str()); + } +} // namespace nghost + +#endif + Deleted: libnghost/src/dao/basedb.hpp =================================================================== --- libnghost/src/dao/basedb.hpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/basedb.hpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -1,324 +0,0 @@ -/* - * timedate - Displays time and date and daily events - * Copyright (c) <2009>, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU Lesser General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef _BASEDB_H_ -#define _BASEDB_H_ - -#include <QObject> -#include <QVariantList> -#include <QSqlDatabase> -#include <QSqlQuery> -#include <QSqlError> -#include <string> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <vector> -#include <ndebug.h> -#include <settings.h> - -using namespace std; -using namespace nghost; - -class BaseDB -{ -public: - BaseDB() - { - - } - - - virtual ~BaseDB() - { - printf("BaseDB: Destroying db object. Table: %s",table.c_str()); - } - - void setTable(string tablename) - { - if(tablename == "") return; - table = tablename; - - if(!tableExists()) - reloadTable(); - } - - virtual void - init(string tablename, string tablestring) - { - string dbname = nghost::getOption("database"); - printf("BaseDB: Initializing db object. Table: %s",tablename.c_str()); - tableString = tablestring; - - QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName(dbname.c_str()); - - nghost::ndebug::out(nghost::ndebug::LOG_INFO, "BaseDB: Using db/db-file: %s",dbname.c_str()); - - if(! db.open()) - { - printf("BaseDB: database not found %s",dbname.c_str()); - exit(1); - } - setTable(tablename); - } - - virtual void - reloadTable() - { - //printf("BaseDB: reloading table %s",table.c_str()); - //dropTable(); - //createTable(); - } - - virtual bool tableExists() - { - bool exists=false; - string query = "SELECT * FROM "+table+" LIMIT 0,1"; - printf("BaseDB: checking for existing table with %s\n",query.c_str()); - QSqlQuery q; - if(!q.exec(query.c_str()) ) - { - printf("BaseDB: Error while exec'ing query:\n"); - printf("Error: %s\n",q.lastError().text().toStdString().c_str()); - return false; - } - int numrows = q.size(); - if(numrows <= 0 ) - exists = false; - else exists = true; - - printf("BaseDB: Table '%s' exists? %d because %d rows where found.\n", table.c_str(), exists, numrows); - return exists; - } - - virtual void - renameTable(string newname) - { - dropTable(newname); - string query = "ALTER TABLE "+table+" RENAME TO "+newname; - QSqlQuery q; - q.exec(query.c_str()); - } - - template<typename T> - void insert(DictionaryList<T> params) - { - string query = "INSERT INTO "+table+" ("; - ostringstream endquery; - endquery<<" VALUES ( "; - for(size_t i=0; i< params.size(); i++) - { - query+=" `"+fixInvalids(params[i].name)+"`"; - ostringstream tempval; - tempval<<params[i].value; - endquery<<"'"<<fixInvalids(tempval.str())<<"'"; - if(i < params.size()-1) - { - query+=","; - endquery<<","; - } - } - endquery<<" )"; - query+=" )"+endquery.str(); - printf("BaseDB: %s",query.c_str()); - QSqlQuery q; - q.exec(query.c_str()); - } - - template<typename T> - void - insert(NameValuePair<T> param) - { - string query = "INSERT INTO "+table+" ("; - ostringstream endquery; - endquery<<" VALUES ( "; - query+=" `"+fixInvalids(param.name)+"`"; - ostringstream tempval; - tempval<<param.value; - endquery<<"'"<<fixInvalids(tempval.str())<<"'"; - endquery<<" )"; - query+=" )"+endquery.str(); - printf("BaseDB: %s",query.c_str()); - QSqlQuery q; - q.exec(query.c_str()); - } - - virtual void - insert(DictionaryList<string> params) - { - insert<string>(params); - } - - template<typename T, typename TT, typename T3> - void - update(T col, TT colval, NameValuePair<T3> qualifier) - { - ostringstream query; - ostringstream tempval; - ostringstream tempcolval; - tempval<<qualifier.value; - tempcolval<<colval; - query << "UPDATE "<< table << - " SET `"<<col<<"` = '"<<fixInvalids(tempcolval.str())<< - "' WHERE `"<<fixInvalids(qualifier.name)<<"` = '"<<fixInvalids(tempval.str())<<"'"; - printf("BaseDB: Update: %s",query.str().c_str()); - QSqlQuery q; - q.exec(query.str().c_str()); - } - - template<typename T, typename TT> - void - update(NameValuePair<T> param, NameValuePair<TT> qualifier) - { - update<string,T,TT>(param.name, param.value, qualifier); - } - - template<typename T, typename TT> - void - update(DictionaryList<T> params, NameValuePair<TT> qualifier) - { - for(size_t i=0;i<params.size();i++) - { - update<T,TT>(params[i],qualifier); - } - } - - virtual void update(NameValuePair<string> param, NameValuePair<string> qualifier) - { - update<string,string>(param,qualifier); - } - - template<typename T> - void deleteRow(NameValuePair<T> qualifier) - { - ostringstream query; - ostringstream tempval; - tempval<<qualifier.value; - query << "DELETE FROM "<< table<< - " WHERE "<<qualifier.name<<" = "<<fixInvalids(tempval.str()); - printf("BaseDB: %s: %s",__FUNCTION__, query.str().c_str()); - QSqlQuery q; - q.exec(query.str().c_str()); - } - - virtual void - deleteRow(NameValuePair<string> qualifier) - { - deleteRow<string>(qualifier); - } - - void - deleteRows(string colname, vector<string> values) - { - ostringstream query; - ostringstream tempval; - QSqlQuery q; - - query << "DELETE FROM "<< table<< - " WHERE "<<colname<<" = ?"; - printf("BaseDB: %s: %s\n",__FUNCTION__, query.str().c_str()); - - q.prepare(query.str().c_str()); - - QVariantList vs; - - for(int i=0; (unsigned)i<values.size(); i++) - { - vs<<QString::fromStdString(values[i]); - } - - q.addBindValue(vs); - q.execBatch(); - } - - virtual void - dropTable() - { - dropTable(table); - } - - virtual void - dropTable(string tablename) - { - string query="DROP TABLE IF EXISTS "+tablename; - printf("BaseDB: Dropping Table %s with query:? %s",tablename.c_str(),query.c_str()); - QSqlQuery q; - q.exec(query.c_str()); - } - - virtual void - createTable() - { - string t = tableString; - string query; - string::size_type i=t.find("%s",0); - if(i!=string::npos) query=t.replace(i, 2, table); - else query = t; - printf("BaseDB: Creating Table %s with query:? %s",table.c_str(),query.c_str()); - QSqlQuery q; - q.exec(query.c_str()); - } - - - - string - fixInvalids(string filename) - { - return filename; - } - -protected: - - void - fixFilename(string* filename) - { - std::string::size_type i=0; - while(1) - { - i = filename->find(" ",i); - if(i == string::npos) - break; - filename->replace(i,1,"\\ "); - i+=2; - } - } - - void - unfixFilename(string* filename) - { - std::string::size_type i=0; - i=filename->find("\\",0); - if(i == string::npos) - return; - else - { - filename->replace(i,1,""); - unfixFilename(filename); - } - - } - - string table; - string tableString; - -}; //BaseDB class - -#endif - Modified: libnghost/src/dao/baseobject.h =================================================================== --- libnghost/src/dao/baseobject.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/baseobject.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -22,7 +22,7 @@ #include <plugin_errorlog.h> -#include "basedb.hpp" +#include "basedb.h" #include <ndebug.h> Modified: libnghost/src/dao/desktopdao.cpp =================================================================== --- libnghost/src/dao/desktopdao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/desktopdao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -17,11 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <QSqlQuery> +#include <QVariant> #include "desktopdao.h" #include "dbtables.h" #include <ndebug.h> -#include <QSqlQuery> #include <vector> #include <string> #include <fstream> Modified: libnghost/src/dao/extendedmediadao.cpp =================================================================== --- libnghost/src/dao/extendedmediadao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/extendedmediadao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -17,6 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <QSqlQuery> +#include <QVariant> #include "extendedmediadao.h" #include "baseobject.h" #include "dbtables.h" @@ -99,7 +101,7 @@ vector<ExMediaObj*> list = getAll(); DictionaryList<string> returnList; - for(uint i=0;i<list.size();i++) + for(unsigned int i=0;i<list.size();i++) { ostringstream combo; string t,a,al; Modified: libnghost/src/dao/listboxdao.cpp =================================================================== --- libnghost/src/dao/listboxdao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/listboxdao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -1,7 +1,8 @@ +#include <QSqlQuery> +#include <QVariant> #include "listboxdao.h" #include "dbtables.h" -#include <QSqlQuery> #include <string> using namespace std; Modified: libnghost/src/dao/listboxdao.h =================================================================== --- libnghost/src/dao/listboxdao.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/listboxdao.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -2,7 +2,7 @@ #define _LISTBOXDAO_H_ #include "baseobject.h" -#include "basedb.hpp" +#include "basedb.h" #include <string> Modified: libnghost/src/dao/mediadao.cpp =================================================================== --- libnghost/src/dao/mediadao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/mediadao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -1,12 +1,12 @@ +#include <QVariant> +#include <QSqlQuery> #include "mediadao.h" -#include "basedb.hpp" +#include "basedb.h" #include "dbtables.h" #include "populate.h" -#include <QSqlQuery> #include <vector> #include <string> -#include "basedb.hpp" using namespace std; Modified: libnghost/src/dao/mediadao.h =================================================================== --- libnghost/src/dao/mediadao.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/mediadao.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -2,7 +2,7 @@ #define _MEDIADAO_H_ #include "baseobject.h" -#include "basedb.hpp" +#include "basedb.h" #include "IListboxDao.h" #include <string> Modified: libnghost/src/dao/playerdao.cpp =================================================================== --- libnghost/src/dao/playerdao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/playerdao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -1,3 +1,5 @@ +#include <QSqlQuery> +#include <QVariant> #include "playerdao.h" #include "baseobject.h" #include "dbtables.h" @@ -56,7 +58,7 @@ DictionaryList<std::string> reallist; - for(uint i=0; i<list.size(); i++) + for(unsigned int i=0; i<list.size(); i++) { //cout<<"PlayerDao: getPlaylist(): list item:"<<list[i]<<endl; reallist.push_back(NameValuePair<string>("",list[i])); @@ -69,7 +71,7 @@ nghost::PlayerDao::setPlaylist(DictionaryList<std::string> filenamelist) { ostringstream list; - for(uint i=0; i<filenamelist.size(); i++) + for(unsigned int i=0; i<filenamelist.size(); i++) { list<<filenamelist[i].value<<","; } Modified: libnghost/src/dao/skindao.cpp =================================================================== --- libnghost/src/dao/skindao.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/dao/skindao.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -47,7 +47,7 @@ string skinname = list.at(list.size()-2); GenericListObject* obj = new GenericListObject(); - uint n = strtoparse.find("skin.xml"); + unsigned int n = strtoparse.find("skin.xml"); obj->name = skinname; if(n != string::npos) Modified: libnghost/src/gui2/listbox.cpp =================================================================== --- libnghost/src/gui2/listbox.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/gui2/listbox.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -17,8 +17,6 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#warning header hell -#include <QVariant> // needed to quell errors about out-of-order headers... would be better to fix this than let it stand #include "listbox.h" #include "listboxdao.h" #include "ndebug.h" Modified: libnghost/src/gui2/listbox.h =================================================================== --- libnghost/src/gui2/listbox.h 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/gui2/listbox.h 2010-03-03 20:48:58 UTC (rev 2068) @@ -150,7 +150,7 @@ image *alpha; private: - std::vector<string> listselections; + std::vector<std::string> listselections; int listposition; int alphapos; int updateAlpha(); Modified: libnghost/src/gui2/nwm.cpp =================================================================== --- libnghost/src/gui2/nwm.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/gui2/nwm.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -18,10 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#warning header hell -// The next two #includes are needed to fix errors about out-of-order headers. Should fix root cause rather than use this patch, but this gets us running -#include <QVariant> -#include <QWidget> #include "nwm.h" #include <input.h> #include <string> Modified: libnghost/src/gui2/screen.cpp =================================================================== --- libnghost/src/gui2/screen.cpp 2010-03-03 19:28:39 UTC (rev 2067) +++ libnghost/src/gui2/screen.cpp 2010-03-03 20:48:58 UTC (rev 2068) @@ -17,8 +17,6 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#warning header hell -#include <QVariant> // needed to quell errors about out-of-order headers... should fix root cause rather than this patch #include "screen.h" #include "settings.h" #include "DaoHelper.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |