Diffstat (limited to 'noncore/apps/tableviewer/db/datacache.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/db/datacache.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp index 6380e1b..de57961 100644 --- a/noncore/apps/tableviewer/db/datacache.cpp +++ b/noncore/apps/tableviewer/db/datacache.cpp @@ -17,5 +17,5 @@ ** not clear to you. ** -**********************************************************************/ +**********************************************************************/ /* * This file is used to load the xml files that represent the database. @@ -64,8 +64,8 @@ DBStore::DBStore() } -//TODO +//TODO /*! - Reinitializes the table to empty (include a resize of the master table, - which should free some memory) + Reinitializes the table to empty (include a resize of the master table, + which should free some memory) */ void DBStore::freeTable() @@ -94,5 +94,5 @@ DBStore::~DBStore() /*! - This function opens the given xml file, loads it and sets up the + This function opens the given xml file, loads it and sets up the appropriate data structures. @@ -102,5 +102,5 @@ DBStore::~DBStore() bool DBStore::openSource(QIODevice *inDev, const QString &source) { - /* first check if db is already open, if contains data.. then clear */ + /* first check if db is already open, if contains data.. then clear */ if(number_elems > 0) { freeTable(); @@ -110,12 +110,12 @@ bool DBStore::openSource(QIODevice *inDev, const QString &source) { archive = new DBXml(this); } else if (source == "text/csv") { - archive = new DBCsv(this); + archive = new DBCsv(this); } else - return false; + return false; return (archive->openSource(inDev)); } -bool DBStore::saveSource(QIODevice *outDev, const QString &source) +bool DBStore::saveSource(QIODevice *outDev, const QString &source) { /* saving a new file */ @@ -123,8 +123,8 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) if (source == "text/x-xml-tableviewer") { archive = new DBXml(this); - } else if (source == "text/x-xml-tableviewer") { + } else if (source == "text/x-xml-tableviewer") { archive = new DBCsv(this); } else - return false; + return false; } @@ -134,8 +134,8 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) if (source == "text/x-xml-tableviewer") { archive = new DBXml(this); - } else if (source == "text/x-xml-tableviewer") { + } else if (source == "text/x-xml-tableviewer") { archive = new DBCsv(this); - } else - return false; + } else + return false; } @@ -143,5 +143,5 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) } -/*! +/*! This function is used to add new elements to the database. If the database has already reached the maximum allowable size this function does not alter @@ -157,7 +157,7 @@ void DBStore::addItem(DataElem *delem) void DBStore::addItemInternal(DataElem *delem) { - /* if already full, don't over fill, do a qWarning though */ + /* if already full, don't over fill, do a owarn though */ if (full) { - owarn << "Attempted to add items to already full table" << oendl; + owarn << "Attempted to add items to already full table" << oendl; return; } @@ -186,11 +186,11 @@ void DBStore::removeItem(DataElem *r) { int position = master_table.findRef(r); - if(position != -1) { - /* there is at least one item, this is it */ - /* replace this with the last element, decrease the element count */ - master_table.insert(position, master_table.at(--number_elems)); - master_table.remove(number_elems); - delete r; - } + if(position != -1) { + /* there is at least one item, this is it */ + /* replace this with the last element, decrease the element count */ + master_table.insert(position, master_table.at(--number_elems)); + master_table.remove(number_elems); + delete r; + } } @@ -202,5 +202,5 @@ void DBStore::removeItem(DataElem *r) void DBStore::setName(const QString &n) { - name = n; + name = n; } @@ -212,9 +212,9 @@ void DBStore::setName(const QString &n) QString DBStore::getName() { - return name; + return name; } /*! - Retrieves a pointer to the key representation of the database for + Retrieves a pointer to the key representation of the database for other classes to use as reference. @@ -236,5 +236,5 @@ void DBStore::setKeys(KeyList *k) /*! - Sets the current element to the first element of the database + Sets the current element to the first element of the database */ void DBStore::first() @@ -244,5 +244,5 @@ void DBStore::first() /*! - Sets the current element to the last element of the database + Sets the current element to the last element of the database */ void DBStore::last() @@ -258,5 +258,5 @@ bool DBStore::next() { unsigned int new_current_elem = current_elem + 1; - if (current_elem < number_elems) + if (current_elem < number_elems) /* was valid before inc (it is possible but unlikely that inc current elem will change it from invalid to valid) */ @@ -279,5 +279,5 @@ bool DBStore::previous() /* was valid */ if (new_current_elem < number_elems) { - /* still is (if was 0, then now -1, but as is unsigned will wrap + /* still is (if was 0, then now -1, but as is unsigned will wrap and hence be invalid */ current_elem = new_current_elem; @@ -289,12 +289,12 @@ bool DBStore::previous() /*! Returns the current data element in the database. Which element is current - is affected by newly added items, findItem, next, previous, first and + is affected by newly added items, findItem, next, previous, first and last functions \return a pointer to the current data element */ -DataElem *DBStore::getCurrentData() +DataElem *DBStore::getCurrentData() { - if (current_elem >= number_elems) + if (current_elem >= number_elems) return NULL; return master_table[current_elem]; |