summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/query.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /noatun-plugins/oblique/query.cpp
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun-plugins/oblique/query.cpp')
-rw-r--r--noatun-plugins/oblique/query.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/noatun-plugins/oblique/query.cpp b/noatun-plugins/oblique/query.cpp
index 292ff16..8c85b59 100644
--- a/noatun-plugins/oblique/query.cpp
+++ b/noatun-plugins/oblique/query.cpp
@@ -8,8 +8,8 @@
#include <klocale.h>
-#include <qdom.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqfile.h>
QueryGroup::QueryGroup()
{
@@ -136,23 +136,23 @@ void QueryGroup::setOption(Option option, bool on)
bool QueryGroup::matches(const File &file) const
{
- QString prop = file.property(propertyName());
+ TQString prop = file.property(propertyName());
prop = prop.simplifyWhiteSpace();
if (prop.isNull()) prop = "";
- QRegExp re(value());
+ TQRegExp re(value());
return re.search(prop) != -1;
}
-QString QueryGroup::presentation(const File &file) const
+TQString QueryGroup::presentation(const File &file) const
{
// "$(property)"
- QString format=presentation();
+ TQString format=presentation();
- QRegExp find("(?:(?:\\\\\\\\))*\\$\\((.*)");
+ TQRegExp find("(?:(?:\\\\\\\\))*\\$\\((.*)");
int start=0;
while (start != -1)
@@ -166,7 +166,7 @@ QString QueryGroup::presentation(const File &file) const
// yes, so half the amount of backslashes
// count how many there are first
- QRegExp counter("([\\\\]+)");
+ TQRegExp counter("([\\\\]+)");
counter.search(format, start-1);
uint len=counter.cap(1).length()-1;
@@ -181,7 +181,7 @@ QString QueryGroup::presentation(const File &file) const
if (format[start]=='\\')
{
// count how many there are first
- QRegExp counter("([\\\\]+)");
+ TQRegExp counter("([\\\\]+)");
counter.search(format, start);
uint len=counter.cap(1).length();
@@ -191,8 +191,8 @@ QString QueryGroup::presentation(const File &file) const
}
// "sth"foo"sth"
- QString cont(find.cap(1));
- QString prefix,suffix,propname;
+ TQString cont(find.cap(1));
+ TQString prefix,suffix,propname;
unsigned int i=0;
if (cont[i] == '"')
{
@@ -231,7 +231,7 @@ QString QueryGroup::presentation(const File &file) const
i++;
- QString propval = file.property(propname);
+ TQString propval = file.property(propname);
// the following code won't be enabled until the presentation is reloaded
// at the best times
@@ -318,27 +318,27 @@ void Query::clear()
mGroupFirst=0;
}
-QString Query::load(const QString &filename)
+TQString Query::load(const TQString &filename)
{
- QFile file(filename);
- unless (file.open(IO_ReadOnly)) return QString::null;
+ TQFile file(filename);
+ unless (file.open(IO_ReadOnly)) return TQString::null;
- QDomDocument doc;
+ TQDomDocument doc;
doc.setContent(&file);
return load(doc.documentElement());
}
-QString Query::load(QDomElement element)
+TQString Query::load(TQDomElement element)
{
clear();
if (element.tagName().lower() == "obliqueschema")
{
- QDomNode node = element.firstChild();
+ TQDomNode node = element.firstChild();
while (!node.isNull())
{
- QDomElement e = node.toElement();
+ TQDomElement e = node.toElement();
if (e.tagName().lower() == "group")
loadGroup(e);
node = node.nextSibling();
@@ -346,20 +346,20 @@ QString Query::load(QDomElement element)
}
else
{
- return QString::null;
+ return TQString::null;
}
// for internationalization:
// Add these if you create new schemas and release them with Oblique
(void)I18N_NOOP("Standard");
- QString title = element.attribute("title");
+ TQString title = element.attribute("title");
if (element.hasAttribute("standard"))
title = i18n(title.utf8());
return title;
}
-void Query::save(const QString &name, QDomElement &element)
+void Query::save(const TQString &name, TQDomElement &element)
{
element.setTagName("ObliqueSchema");
element.setAttribute("version", "1.0");
@@ -368,22 +368,22 @@ void Query::save(const QString &name, QDomElement &element)
saveGroup(element, g);
}
-void Query::save(const QString &name, const QString &filename)
+void Query::save(const TQString &name, const TQString &filename)
{
- QFile file(filename);
+ TQFile file(filename);
unless (file.open(IO_Truncate|IO_ReadWrite ))
return;
- QDomDocument doc("ObliqueSchema");
- doc.setContent(QString("<!DOCTYPE ObliqueSchema><ObliqueSchema/>"));
- QDomElement e = doc.documentElement();
+ TQDomDocument doc("ObliqueSchema");
+ doc.setContent(TQString("<!DOCTYPE ObliqueSchema><ObliqueSchema/>"));
+ TQDomElement e = doc.documentElement();
save(name, e);
- QTextStream ts(&file);
- ts.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream ts(&file);
+ ts.setEncoding(TQTextStream::UnicodeUTF8);
// scourge elimination
- QString data = doc.toString();
- QString old = data;
- while (data.replace(QRegExp("([\n\r]+)(\t*) "), "\\1\\2\t") != old)
+ TQString data = doc.toString();
+ TQString old = data;
+ while (data.replace(TQRegExp("([\n\r]+)(\t*) "), "\\1\\2\t") != old)
{
old = data;
}
@@ -438,9 +438,9 @@ void Query::dump()
-void Query::loadGroup(QDomElement element, QueryGroup *parent)
+void Query::loadGroup(TQDomElement element, QueryGroup *parent)
{
- QDomNode node = element.firstChild();
+ TQDomNode node = element.firstChild();
QueryGroup *group = new QueryGroup;
if (parent)
@@ -457,7 +457,7 @@ void Query::loadGroup(QDomElement element, QueryGroup *parent)
while (!node.isNull())
{
- QDomElement e = node.toElement();
+ TQDomElement e = node.toElement();
if (e.tagName().lower() == "group")
{
loadGroup(e, group);
@@ -468,7 +468,7 @@ void Query::loadGroup(QDomElement element, QueryGroup *parent)
}
else if (e.tagName().lower() == "value")
{
- group->setValue(QRegExp(e.text()));
+ group->setValue(TQRegExp(e.text()));
}
else if (e.tagName().lower() == "presentation")
{
@@ -476,10 +476,10 @@ void Query::loadGroup(QDomElement element, QueryGroup *parent)
}
else if (e.tagName().lower() == "options")
{
- QDomNode node = e.firstChild();
+ TQDomNode node = e.firstChild();
while (!node.isNull())
{
- QDomElement e = node.toElement();
+ TQDomElement e = node.toElement();
if (e.tagName().lower() == "disabled")
group->setOption(QueryGroup::Disabled, true);
@@ -500,14 +500,14 @@ void Query::loadGroup(QDomElement element, QueryGroup *parent)
}
}
-void Query::saveGroup(QDomElement &parent, QueryGroup *group)
+void Query::saveGroup(TQDomElement &parent, QueryGroup *group)
{
- QDomDocument doc = parent.ownerDocument();
- QDomElement element = doc.createElement("group");
+ TQDomDocument doc = parent.ownerDocument();
+ TQDomElement element = doc.createElement("group");
parent.appendChild(element);
- QDomElement childe;
- QDomText childtext;
+ TQDomElement childe;
+ TQDomText childtext;
{
childe = doc.createElement("property");
element.appendChild(childe);