summaryrefslogtreecommitdiffstats
path: root/konq-plugins/webarchiver
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /konq-plugins/webarchiver
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/webarchiver')
-rw-r--r--konq-plugins/webarchiver/archivedialog.cpp32
-rw-r--r--konq-plugins/webarchiver/archivedialog.h3
-rw-r--r--konq-plugins/webarchiver/archiveviewbase.ui12
-rw-r--r--konq-plugins/webarchiver/plugin_webarchiver.cpp22
-rw-r--r--konq-plugins/webarchiver/plugin_webarchiver.h3
-rw-r--r--konq-plugins/webarchiver/webarchivecreator.h1
6 files changed, 38 insertions, 35 deletions
diff --git a/konq-plugins/webarchiver/archivedialog.cpp b/konq-plugins/webarchiver/archivedialog.cpp
index a28da2c..77ca40d 100644
--- a/konq-plugins/webarchiver/archivedialog.cpp
+++ b/konq-plugins/webarchiver/archivedialog.cpp
@@ -49,9 +49,9 @@
#define CONTENT_TYPE "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">"
-ArchiveDialog::ArchiveDialog(TQWidget *parent, const TQString &filename,
+ArchiveDialog::ArchiveDialog(TQWidget *tqparent, const TQString &filename,
KHTMLPart *part) :
- KDialogBase(parent, "WebArchiveDialog", false, i18n("Web Archiver"),
+ KDialogBase(tqparent, "WebArchiveDialog", false, i18n("Web Archiver"),
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::User1 ),
m_bPreserveWS(false), m_tmpFile(0), m_url(part->url())
{
@@ -88,7 +88,7 @@ void ArchiveDialog::archive()
} else {
const TQString title = i18n( "Unable to Open Web-Archive" );
- const TQString text = i18n( "Unable to open \n %1 \n for writing." ).arg(m_tarBall->fileName());
+ const TQString text = i18n( "Unable to open \n %1 \n for writing." ).tqarg(m_tarBall->fileName());
KMessageBox::sorry( 0L, text, title );
}
}
@@ -144,7 +144,7 @@ void ArchiveDialog::setSavingState()
TQString fileName="index.html";
TQFile file(tmpFile.name());
file.open(IO_ReadOnly);
- m_tarBall->writeFile(fileName, TQString::null, TQString::null, file.size(), file.readAll());
+ m_tarBall->writeFile(fileName, TQString(), TQString(), file.size(), file.readAll());
#ifdef DEBUG_WAR
kdDebug(90110) << "HTML-file written: " << fileName << endl;
#endif
@@ -207,7 +207,7 @@ static bool hasChildNode(const DOM::Node &pNode, const TQString &nodeName)
}
catch (...)
{
- // No children, stop recursion here
+ // No tqchildren, stop recursion here
child = DOM::Node();
}
@@ -237,12 +237,12 @@ void ArchiveDialog::saveArchiveRecursive(const DOM::Node &pNode, const KURL& bas
/* Don't save khtml internal tags '-konq..'
* Approximating it with <DIV>
*/
- text += "<DIV> <!-- -KONQ_BLOCK -->";
+ text += "<DIV> <!-- -KONTQ_BLOCK -->";
} else if (nodeName == "BASE") {
/* Skip BASE, everything is relative to index.html
* Saving SCRIPT but they can cause trouble!
*/
- } else if ((nodeName == "META") && hasAttribute(pNode, "HTTP-EQUIV", "CONTENT-TYPE")) {
+ } else if ((nodeName == "META") && hasAttribute(pNode, "HTTP-ETQUIV", "CONTENT-TYPE")) {
/* Skip content-type meta tag, we provide our own.
*/
} else {
@@ -284,7 +284,7 @@ void ArchiveDialog::saveArchiveRecursive(const DOM::Node &pNode, const KURL& bas
((nodeName == "IMG" || nodeName == "INPUT" || nodeName == "SCRIPT") && attrName == "SRC") ||
((nodeName == "BODY" || nodeName == "TABLE" || nodeName == "TH" || nodeName == "TD") && attrName == "BACKGROUND")) {
// Some people use carriage return in file names and browsers support that!
- attrValue = handleLink(baseURL, attrValue.replace(TQRegExp("\\s"), ""));
+ attrValue = handleLink(baseURL, attrValue.tqreplace(TQRegExp("\\s"), ""));
}
/*
* ## Make recursion level configurable
@@ -346,7 +346,7 @@ void ArchiveDialog::saveArchiveRecursive(const DOM::Node &pNode, const KURL& bas
}
catch (...)
{
- // No children, stop recursion here
+ // No tqchildren, stop recursion here
child = DOM::Node();
}
@@ -370,7 +370,7 @@ void ArchiveDialog::saveArchiveRecursive(const DOM::Node &pNode, const KURL& bas
text ="";
}
if (nodeName.at(0)=='-') {
- text += "</DIV> <!-- -KONQ_BLOCK -->";
+ text += "</DIV> <!-- -KONTQ_BLOCK -->";
} else {
text += "</" + pNode.nodeName().string() + ">";
if (nodeName == "PRE") {
@@ -425,7 +425,7 @@ void ArchiveDialog::downloadNext()
TQString tarFileName;
// Only download file once
- if (m_downloadedURLDict.contains(url.url())) {
+ if (m_downloadedURLDict.tqcontains(url.url())) {
tarFileName = m_downloadedURLDict[url.url()];
#ifdef DEBUG_WAR
kdDebug(90110) << "File already downloaded: " << url.url()
@@ -477,7 +477,7 @@ void ArchiveDialog::finishedDownloadingURL( KIO::Job *job )
// Add file to Tar-Ball
TQFile file(m_tmpFile->name());
file.open(IO_ReadOnly);
- m_tarBall->writeFile(tarFileName, TQString::null, TQString::null, file.size(), file.readAll());
+ m_tarBall->writeFile(tarFileName, TQString(), TQString(), file.size(), file.readAll());
file.close();
m_tmpFile->unlink();
delete m_tmpFile;
@@ -512,7 +512,7 @@ TQString ArchiveDialog::getUniqueFileName(const TQString& fileName)
kdDebug(90110) << "getUniqueFileName(..): [" << fileName << "]" << endl;
#endif
- while (uniqueFileName.isEmpty() || m_linkDict.contains(uniqueFileName))
+ while (uniqueFileName.isEmpty() || m_linkDict.tqcontains(uniqueFileName))
uniqueFileName = TQString::number(id++) + fileName;
return uniqueFileName;
@@ -532,14 +532,14 @@ TQString ArchiveDialog::analyzeInternalCSS(const KURL& _url, const TQString& str
int endUrl = 0;
int length = string.length();
while (pos < length && pos >= 0) {
- pos = str.find("url(", pos);
+ pos = str.tqfind("url(", pos);
if (pos!=-1) {
pos += 4; // url(
if (str[pos]=='"' || str[pos]=='\'') // CSS 'feature'
pos++;
startUrl = pos;
- pos = str.find(")",startUrl);
+ pos = str.tqfind(")",startUrl);
endUrl = pos;
if (str[pos-1]=='"' || str[pos-1]=='\'') // CSS 'feature'
endUrl--;
@@ -555,7 +555,7 @@ TQString ArchiveDialog::analyzeInternalCSS(const KURL& _url, const TQString& str
kdDebug () << "url: " << url << endl;
#endif
- str = str.replace(startUrl, endUrl-startUrl, url);
+ str = str.tqreplace(startUrl, endUrl-startUrl, url);
pos++;
}
}
diff --git a/konq-plugins/webarchiver/archivedialog.h b/konq-plugins/webarchiver/archivedialog.h
index 6748328..d82b9b0 100644
--- a/konq-plugins/webarchiver/archivedialog.h
+++ b/konq-plugins/webarchiver/archivedialog.h
@@ -42,8 +42,9 @@ class TQListViewItem;
class ArchiveDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- ArchiveDialog(TQWidget *parent, const TQString &targetFilename, KHTMLPart *part);
+ ArchiveDialog(TQWidget *tqparent, const TQString &targetFilename, KHTMLPart *part);
~ArchiveDialog();
void archive();
diff --git a/konq-plugins/webarchiver/archiveviewbase.ui b/konq-plugins/webarchiver/archiveviewbase.ui
index a2aceb2..8e5ca1e 100644
--- a/konq-plugins/webarchiver/archiveviewbase.ui
+++ b/konq-plugins/webarchiver/archiveviewbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>ArchiveViewBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>ArchiveViewBase</cstring>
</property>
@@ -19,9 +19,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>tqlayout4</cstring>
</property>
<grid>
<property name="name">
@@ -43,7 +43,7 @@
<string>Local File</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
@@ -51,7 +51,7 @@
<string>To:</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -119,7 +119,7 @@
</widget>
<customwidgets>
</customwidgets>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kactivelabel.h</includehint>
<includehint>kactivelabel.h</includehint>
diff --git a/konq-plugins/webarchiver/plugin_webarchiver.cpp b/konq-plugins/webarchiver/plugin_webarchiver.cpp
index c76f56c..280b0e2 100644
--- a/konq-plugins/webarchiver/plugin_webarchiver.cpp
+++ b/konq-plugins/webarchiver/plugin_webarchiver.cpp
@@ -50,9 +50,9 @@ typedef KGenericFactory<PluginWebArchiver> PluginWebArchiverFactory;
K_EXPORT_COMPONENT_FACTORY( libwebarchiverplugin,
PluginWebArchiverFactory( "webarchiver" ) )
-PluginWebArchiver::PluginWebArchiver( TQObject* parent, const char* name,
+PluginWebArchiver::PluginWebArchiver( TQObject* tqparent, const char* name,
const TQStringList & )
- : Plugin( parent, name )
+ : Plugin( tqparent, name )
{
(void) new KAction( i18n("Archive &Web Page..."),
"webarchiver", 0,
@@ -67,9 +67,9 @@ PluginWebArchiver::~PluginWebArchiver()
void PluginWebArchiver::slotSaveToArchive()
{
// ## Unicode ok?
- if( !parent() || !parent()->inherits("KHTMLPart"))
+ if( !tqparent() || !tqparent()->inherits("KHTMLPart"))
return;
- KHTMLPart *part = static_cast<KHTMLPart *>( parent() );
+ KHTMLPart *part = static_cast<KHTMLPart *>( tqparent() );
TQString archiveName = TQString::fromUtf8(part->htmlDocument().title().string().utf8());
@@ -78,12 +78,12 @@ void PluginWebArchiver::slotSaveToArchive()
// Replace space with underscore, proposed Frank Pieczynski <pieczy@knuut.de>
- archiveName.replace( "\\s:", " ");
+ archiveName.tqreplace( "\\s:", " ");
archiveName = archiveName.simplifyWhiteSpace();
- archiveName.replace( "?", "");
- archiveName.replace( ":", "");
- archiveName.replace( "/", "");
- archiveName = archiveName.replace( TQRegExp("\\s+"), "_");
+ archiveName.tqreplace( "?", "");
+ archiveName.tqreplace( ":", "");
+ archiveName.tqreplace( "/", "");
+ archiveName = archiveName.tqreplace( TQRegExp("\\s+"), "_");
archiveName = KGlobalSettings::documentPath() + "/" + archiveName + ".war" ;
@@ -94,7 +94,7 @@ void PluginWebArchiver::slotSaveToArchive()
if (!(url.isValid())) {
const TQString title = i18n( "Invalid URL" );
- const TQString text = i18n( "The URL\n%1\nis not valid." ).arg(url.prettyURL());
+ const TQString text = i18n( "The URL\n%1\nis not valid." ).tqarg(url.prettyURL());
KMessageBox::sorry(part->widget(), text, title );
return;
}
@@ -102,7 +102,7 @@ void PluginWebArchiver::slotSaveToArchive()
const TQFile file(url.path());
if (file.exists()) {
const TQString title = i18n( "File Exists" );
- const TQString text = i18n( "Do you really want to overwrite:\n%1?" ).arg(url.prettyURL());
+ const TQString text = i18n( "Do you really want to overwrite:\n%1?" ).tqarg(url.prettyURL());
if (KMessageBox::Continue != KMessageBox::warningContinueCancel( part->widget(), text, title, i18n("Overwrite") ) ) {
return;
}
diff --git a/konq-plugins/webarchiver/plugin_webarchiver.h b/konq-plugins/webarchiver/plugin_webarchiver.h
index 530e15b..338eec8 100644
--- a/konq-plugins/webarchiver/plugin_webarchiver.h
+++ b/konq-plugins/webarchiver/plugin_webarchiver.h
@@ -28,9 +28,10 @@
class PluginWebArchiver : public KParts::Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- PluginWebArchiver( TQObject* parent, const char* name,
+ PluginWebArchiver( TQObject* tqparent, const char* name,
const TQStringList & );
virtual ~PluginWebArchiver();
diff --git a/konq-plugins/webarchiver/webarchivecreator.h b/konq-plugins/webarchiver/webarchivecreator.h
index 8806390..dfeba5d 100644
--- a/konq-plugins/webarchiver/webarchivecreator.h
+++ b/konq-plugins/webarchiver/webarchivecreator.h
@@ -29,6 +29,7 @@ class KHTMLPart;
class WebArchiveCreator : public TQObject, public ThumbCreator
{
Q_OBJECT
+ TQ_OBJECT
public:
WebArchiveCreator();
virtual ~WebArchiveCreator();