summaryrefslogtreecommitdiffstats
path: root/src/viewproperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/viewproperties.cpp')
-rw-r--r--src/viewproperties.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/viewproperties.cpp b/src/viewproperties.cpp
index 66d5935..25f8af3 100644
--- a/src/viewproperties.cpp
+++ b/src/viewproperties.cpp
@@ -20,9 +20,9 @@
#include <assert.h>
-#include <qdatetime.h>
-#include <qdir.h>
-#include <qfile.h>
+#include <tqdatetime.h>
+#include <tqdir.h>
+#include <tqfile.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -41,7 +41,7 @@ ViewProperties::ViewProperties(KURL url) :
url.cleanPath(true);
m_filepath = url.path();
- if ((m_filepath.length() < 1) || (m_filepath.at(0) != QChar('/'))) {
+ if ((m_filepath.length() < 1) || (m_filepath.at(0) != TQChar('/'))) {
return;
}
@@ -50,41 +50,41 @@ ViewProperties::ViewProperties(KURL url) :
// we store the properties information in a local file
DolphinSettings& settings = DolphinSettings::instance();
if (settings.isSaveView()) {
- QString rootDir("/"); // TODO: should this be set to the root of the bookmark, if any?
+ TQString rootDir("/"); // TODO: should this be set to the root of the bookmark, if any?
if (url.isLocalFile()) {
- QFileInfo info(m_filepath);
+ TQFileInfo info(m_filepath);
if (!info.isWritable()) {
- QString basePath = KGlobal::instance()->instanceName();
+ TQString basePath = KGlobal::instance()->instanceName();
basePath.append("/view_properties/local");
rootDir = locateLocal("data", basePath);
m_filepath = rootDir + m_filepath;
}
}
else {
- QString basePath = KGlobal::instance()->instanceName();
+ TQString basePath = KGlobal::instance()->instanceName();
basePath.append("/view_properties/remote/").append(url.host());
rootDir = locateLocal("data", basePath);
m_filepath = rootDir + m_filepath;
}
- QDir dir(m_filepath);
- QFile file(m_filepath + FILE_NAME);
+ TQDir dir(m_filepath);
+ TQFile file(m_filepath + FILE_NAME);
PropertiesNode node(&file);
const bool isValidForSubDirs = !node.isEmpty() && node.isValidForSubDirs();
while ((dir.path() != rootDir) && dir.cdUp()) {
- QFile file(dir.path() + FILE_NAME);
- PropertiesNode parentNode(&file);
- if (!parentNode.isEmpty()) {
- const bool inheritProps = parentNode.isValidForSubDirs() &&
- (parentNode.subDirProperties().m_timeStamp >
+ TQFile file(dir.path() + FILE_NAME);
+ PropertiesNode tqparentNode(&file);
+ if (!tqparentNode.isEmpty()) {
+ const bool inheritProps = tqparentNode.isValidForSubDirs() &&
+ (tqparentNode.subDirProperties().m_timeStamp >
node.localProperties().m_timeStamp);
if (inheritProps) {
- node.setLocalProperties(parentNode.subDirProperties());
+ node.setLocalProperties(tqparentNode.subDirProperties());
break;
}
}
@@ -145,7 +145,7 @@ DolphinView::Sorting ViewProperties::sorting() const
return m_node.localProperties().m_sorting;
}
-void ViewProperties::setSortOrder(Qt::SortOrder sortOrder)
+void ViewProperties::setSortOrder(TQt::SortOrder sortOrder)
{
if (m_node.localProperties().m_sortOrder != sortOrder) {
m_node.setSortOrder(sortOrder);
@@ -153,7 +153,7 @@ void ViewProperties::setSortOrder(Qt::SortOrder sortOrder)
}
}
-Qt::SortOrder ViewProperties::sortOrder() const
+TQt::SortOrder ViewProperties::sortOrder() const
{
return m_node.localProperties().m_sortOrder;
}
@@ -185,7 +185,7 @@ void ViewProperties::save()
{
DolphinSettings& settings = DolphinSettings::instance();
if (settings.isSaveView()) {
- QFile file(m_filepath + FILE_NAME);
+ TQFile file(m_filepath + FILE_NAME);
KStandardDirs::makeDir(m_filepath);
if (!file.open(IO_WriteOnly)) {
return;
@@ -196,13 +196,13 @@ void ViewProperties::save()
char sorting = static_cast<char>(props.m_sorting) + '0';
const bool isValidForSubDirs = m_node.isValidForSubDirs() || m_subDirValidityHidden;
- QTextStream stream(&file);
+ TQTextStream stream(&file);
stream << "V01"
<< viewMode
<< (props.m_showHiddenFiles ? '1' : '0')
<< props.m_timeStamp.toString("yyyyMMddhhmmss")
<< sorting
- << ((props.m_sortOrder == Qt::Ascending) ? 'A' : 'D')
+ << ((props.m_sortOrder == TQt::Ascending) ? 'A' : 'D')
<< (isValidForSubDirs ? '1' : '0');
if (m_node.isValidForSubDirs()) {
@@ -217,7 +217,7 @@ void ViewProperties::save()
<< (subDirProps.m_showHiddenFiles ? '1' : '0')
<< subDirProps.m_timeStamp.toString("yyyyMMddhhmmss")
<< sorting
- << ((subDirProps.m_sortOrder == Qt::Ascending) ? 'A' : 'D');
+ << ((subDirProps.m_sortOrder == TQt::Ascending) ? 'A' : 'D');
}
file.flush();
file.close();
@@ -229,17 +229,17 @@ void ViewProperties::save()
void ViewProperties::updateTimeStamp()
{
m_changedProps = true;
- m_node.setTimeStamp(QDateTime::currentDateTime());
+ m_node.setTimeStamp(TQDateTime::tqcurrentDateTime());
}
ViewProperties::Properties::Properties() :
m_showHiddenFiles(false),
m_viewMode(DolphinView::IconsView),
m_sorting(DolphinView::SortByName),
- m_sortOrder(Qt::Ascending)
+ m_sortOrder(TQt::Ascending)
{
- m_timeStamp.setDate(QDate(1999, 12, 31));
- m_timeStamp.setTime(QTime(23, 59, 59));
+ m_timeStamp.setDate(TQDate(1999, 12, 31));
+ m_timeStamp.setTime(TQTime(23, 59, 59));
m_viewMode = DolphinSettings::instance().defaultViewMode();
}
@@ -248,7 +248,7 @@ ViewProperties::Properties::~Properties()
{
}
-ViewProperties::PropertiesNode::PropertiesNode(QFile* file) :
+ViewProperties::PropertiesNode::PropertiesNode(TQFile* file) :
m_empty(true)
{
m_isValidForSubDirs = false;
@@ -332,18 +332,18 @@ int ViewProperties::PropertiesNode::readProperties(Properties& props,
props.m_showHiddenFiles = (buffer[1] != '0');
// read date
- QDateTime timeStamp;
+ TQDateTime timeStamp;
const int year = toInt(&(buffer[2]), 4);
const int month = toInt(&(buffer[6]), 2);
const int day = toInt(&(buffer[8]), 2);
- QDate date(year, month, day);
+ TQDate date(year, month, day);
timeStamp.setDate(date);
// read time
const int hour = toInt(&(buffer[10]), 2);
const int minute = toInt(&(buffer[12]), 2);
const int second = toInt(&(buffer[14]), 2);
- QTime time(hour, minute, second);
+ TQTime time(hour, minute, second);
timeStamp.setTime(time);
props.m_timeStamp = timeStamp;
@@ -352,7 +352,7 @@ int ViewProperties::PropertiesNode::readProperties(Properties& props,
if (version >= 1) {
// read sorting type and sorting order
props.m_sorting = static_cast<DolphinView::Sorting>(buffer[16] - '0');
- props.m_sortOrder = (buffer[17] == 'A') ? Qt::Ascending : Qt::Descending;
+ props.m_sortOrder = (buffer[17] == 'A') ? TQt::Ascending : TQt::Descending;
readCount = 18;
}