|
|
|
@ -323,7 +323,7 @@ AlbumInfo::List AlbumDB::scanAlbums()
|
|
|
|
|
++it;
|
|
|
|
|
info.url = *it;
|
|
|
|
|
++it;
|
|
|
|
|
info.date = TQDate::fromString(*it, Qt::ISODate);
|
|
|
|
|
info.date = TQDate::fromString(*it, TQt::ISODate);
|
|
|
|
|
++it;
|
|
|
|
|
info.caption = *it;
|
|
|
|
|
++it;
|
|
|
|
@ -433,7 +433,7 @@ int AlbumDB::addAlbum(const TQString& url, const TQString& caption,
|
|
|
|
|
execSql( TQString("REPLACE INTO Albums (url, date, caption, collection) "
|
|
|
|
|
"VALUES('%1', '%2', '%3', '%4');")
|
|
|
|
|
.arg(escapeString(url),
|
|
|
|
|
date.toString(Qt::ISODate),
|
|
|
|
|
date.toString(TQt::ISODate),
|
|
|
|
|
escapeString(caption),
|
|
|
|
|
escapeString(collection)));
|
|
|
|
|
|
|
|
|
@ -458,7 +458,7 @@ void AlbumDB::setAlbumCollection(int albumID, const TQString& collection)
|
|
|
|
|
void AlbumDB::setAlbumDate(int albumID, const TQDate& date)
|
|
|
|
|
{
|
|
|
|
|
execSql( TQString("UPDATE Albums SET date='%1' WHERE id=%2;")
|
|
|
|
|
.arg(date.toString(Qt::ISODate))
|
|
|
|
|
.arg(date.toString(TQt::ISODate))
|
|
|
|
|
.arg(albumID) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -766,7 +766,7 @@ TQDateTime AlbumDB::getItemDate(TQ_LLONG imageID)
|
|
|
|
|
if (values.isEmpty())
|
|
|
|
|
return TQDateTime();
|
|
|
|
|
else
|
|
|
|
|
return TQDateTime::fromString(values[0], Qt::ISODate);
|
|
|
|
|
return TQDateTime::fromString(values[0], TQt::ISODate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQDateTime AlbumDB::getItemDate(int albumID, const TQString& name)
|
|
|
|
@ -782,7 +782,7 @@ TQDateTime AlbumDB::getItemDate(int albumID, const TQString& name)
|
|
|
|
|
if (values.isEmpty())
|
|
|
|
|
return TQDateTime();
|
|
|
|
|
else
|
|
|
|
|
return TQDateTime::fromString(values[0], Qt::ISODate);
|
|
|
|
|
return TQDateTime::fromString(values[0], TQt::ISODate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQ_LLONG AlbumDB::getImageId(int albumID, const TQString& name)
|
|
|
|
@ -1027,7 +1027,7 @@ int AlbumDB::getOrCreateAlbumId(const TQString& folder)
|
|
|
|
|
execSql( TQString ("INSERT INTO Albums (url, date) "
|
|
|
|
|
"VALUES ('%1','%2')")
|
|
|
|
|
.arg(escapeString(folder),
|
|
|
|
|
TQDateTime::currentDateTime().toString(Qt::ISODate)) );
|
|
|
|
|
TQDateTime::currentDateTime().toString(TQt::ISODate)) );
|
|
|
|
|
albumID = sqlite3_last_insert_rowid(d->dataBase);
|
|
|
|
|
} else
|
|
|
|
|
albumID = values[0].toInt();
|
|
|
|
@ -1046,7 +1046,7 @@ TQ_LLONG AlbumDB::addItem(int albumID,
|
|
|
|
|
"( caption , datetime, name, dirid ) "
|
|
|
|
|
" VALUES ('%1','%2','%3',%4) " )
|
|
|
|
|
.arg(escapeString(comment),
|
|
|
|
|
datetime.toString(Qt::ISODate),
|
|
|
|
|
datetime.toString(TQt::ISODate),
|
|
|
|
|
escapeString(name),
|
|
|
|
|
TQString::number(albumID)) );
|
|
|
|
|
|
|
|
|
@ -1278,7 +1278,7 @@ bool AlbumDB::setItemDate(TQ_LLONG imageID,
|
|
|
|
|
{
|
|
|
|
|
execSql ( TQString ("UPDATE Images SET datetime='%1'"
|
|
|
|
|
"WHERE id=%2;")
|
|
|
|
|
.arg(datetime.toString(Qt::ISODate),
|
|
|
|
|
.arg(datetime.toString(TQt::ISODate),
|
|
|
|
|
TQString::number(imageID)) );
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
@ -1289,7 +1289,7 @@ bool AlbumDB::setItemDate(int albumID, const TQString& name,
|
|
|
|
|
{
|
|
|
|
|
execSql ( TQString ("UPDATE Images SET datetime='%1'"
|
|
|
|
|
"WHERE dirid=%2 AND name='%3';")
|
|
|
|
|
.arg(datetime.toString(Qt::ISODate),
|
|
|
|
|
.arg(datetime.toString(TQt::ISODate),
|
|
|
|
|
TQString::number(albumID),
|
|
|
|
|
escapeString(name)) );
|
|
|
|
|
|
|
|
|
@ -1456,7 +1456,7 @@ TQDate AlbumDB::getAlbumLowestDate(int albumID)
|
|
|
|
|
execSql( TQString("SELECT MIN(datetime) FROM Images "
|
|
|
|
|
"WHERE dirid=%1 GROUP BY dirid")
|
|
|
|
|
.arg( albumID ), &values);
|
|
|
|
|
TQDate itemDate = TQDate::fromString( values[0], Qt::ISODate );
|
|
|
|
|
TQDate itemDate = TQDate::fromString( values[0], TQt::ISODate );
|
|
|
|
|
return itemDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1466,7 +1466,7 @@ TQDate AlbumDB::getAlbumHighestDate(int albumID)
|
|
|
|
|
execSql( TQString("SELECT MAX(datetime) FROM Images "
|
|
|
|
|
"WHERE dirid=%1 GROUP BY dirid")
|
|
|
|
|
.arg( albumID ), &values);
|
|
|
|
|
TQDate itemDate = TQDate::fromString( values[0], Qt::ISODate );
|
|
|
|
|
TQDate itemDate = TQDate::fromString( values[0], TQt::ISODate );
|
|
|
|
|
return itemDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1482,7 +1482,7 @@ TQDate AlbumDB::getAlbumAverageDate(int albumID)
|
|
|
|
|
|
|
|
|
|
for (TQStringList::iterator it = values.begin(); it != values.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
TQDateTime itemDateTime = TQDateTime::fromString( *it, Qt::ISODate );
|
|
|
|
|
TQDateTime itemDateTime = TQDateTime::fromString( *it, TQt::ISODate );
|
|
|
|
|
if (itemDateTime.isValid())
|
|
|
|
|
{
|
|
|
|
|
++amountOfImages;
|
|
|
|
|