summaryrefslogtreecommitdiffstats
path: root/konq-plugins/uachanger/uachangerplugin.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 /konq-plugins/uachanger/uachangerplugin.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 'konq-plugins/uachanger/uachangerplugin.cpp')
-rw-r--r--konq-plugins/uachanger/uachangerplugin.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/konq-plugins/uachanger/uachangerplugin.cpp b/konq-plugins/uachanger/uachangerplugin.cpp
index b929930..b6ad880 100644
--- a/konq-plugins/uachanger/uachangerplugin.cpp
+++ b/konq-plugins/uachanger/uachangerplugin.cpp
@@ -20,7 +20,7 @@
#include <sys/utsname.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <krun.h>
#include <kdebug.h>
@@ -47,11 +47,11 @@ K_EXPORT_COMPONENT_FACTORY (libuachangerplugin, UAChangerPluginFactory (&aboutda
#define UA_PTOS(x) (*it)->property(x).toString()
-#define QFL1(x) QString::fromLatin1(x)
+#define QFL1(x) TQString::fromLatin1(x)
-UAChangerPlugin::UAChangerPlugin( QObject* parent, const char* name,
- const QStringList & )
+UAChangerPlugin::UAChangerPlugin( TQObject* parent, const char* name,
+ const TQStringList & )
:KParts::Plugin( parent, name ),
m_bSettingsLoaded(false), m_part(0L), m_config(0L)
{
@@ -60,16 +60,16 @@ UAChangerPlugin::UAChangerPlugin( QObject* parent, const char* name,
m_pUAMenu = new KActionMenu( i18n("Change Browser &Identification"), "agent",
actionCollection(), "changeuseragent" );
m_pUAMenu->setDelayed( false );
- connect( m_pUAMenu->popupMenu(), SIGNAL( aboutToShow() ),
- this, SLOT( slotAboutToShow() ) );
+ connect( m_pUAMenu->popupMenu(), TQT_SIGNAL( aboutToShow() ),
+ this, TQT_SLOT( slotAboutToShow() ) );
m_pUAMenu->setEnabled ( false );
if ( parent && parent->inherits( "KHTMLPart" ) )
{
m_part = static_cast<KHTMLPart*>(parent);
- connect( m_part, SIGNAL(started(KIO::Job*)), this,
- SLOT(slotStarted(KIO::Job*)) );
+ connect( m_part, TQT_SIGNAL(started(KIO::Job*)), this,
+ TQT_SLOT(slotStarted(KIO::Job*)) );
}
}
@@ -98,10 +98,10 @@ void UAChangerPlugin::parseDescFiles()
struct utsname utsn;
uname( &utsn );
- QStringList languageList = KGlobal::locale()->languageList();
+ TQStringList languageList = KGlobal::locale()->languageList();
if ( languageList.count() )
{
- QStringList::Iterator it = languageList.find(QFL1("C"));
+ TQStringList::Iterator it = languageList.find(QFL1("C"));
if( it != languageList.end() )
{
if( languageList.contains( QFL1("en") ) > 0 )
@@ -116,8 +116,8 @@ void UAChangerPlugin::parseDescFiles()
for ( ; it != lastItem; ++it )
{
- QString tmp = UA_PTOS("X-KDE-UA-FULL");
- QString tag = UA_PTOS("X-KDE-UA-TAG");
+ TQString tmp = UA_PTOS("X-KDE-UA-FULL");
+ TQString tag = UA_PTOS("X-KDE-UA-TAG");
if(tag != "IE" && tag != "NN" && tag != "MOZ")
tag = "OTHER";
@@ -135,14 +135,14 @@ void UAChangerPlugin::parseDescFiles()
continue; // Ignore dups!
m_lstIdentity << tmp;
- tmp = QString("%1 %2").arg(UA_PTOS("X-KDE-UA-SYSNAME")).arg(UA_PTOS("X-KDE-UA-SYSRELEASE"));
+ tmp = TQString("%1 %2").arg(UA_PTOS("X-KDE-UA-SYSNAME")).arg(UA_PTOS("X-KDE-UA-SYSRELEASE"));
if ( tmp.stripWhiteSpace().isEmpty() )
{
if(tag == "NN" || tag == "IE" || tag == "MOZ")
tmp = i18n("Version %1").arg(UA_PTOS("X-KDE-UA-VERSION"));
else
- tmp = QString("%1 %2").arg(UA_PTOS("X-KDE-UA-NAME")).arg(UA_PTOS("X-KDE-UA-VERSION"));
+ tmp = TQString("%1 %2").arg(UA_PTOS("X-KDE-UA-NAME")).arg(UA_PTOS("X-KDE-UA-VERSION"));
}
else
{
@@ -161,7 +161,7 @@ void UAChangerPlugin::parseDescFiles()
{
if ( m_lstAlias[(*e)] > tmp ) {
ualist.insert( e, m_lstAlias.count()-1 );
- tmp = QString::null;
+ tmp = TQString::null;
}
++e;
}
@@ -184,7 +184,7 @@ void UAChangerPlugin::slotStarted( KIO::Job* )
m_currentURL = m_part->url();
// This plugin works on local files, http[s], and webdav[s].
- QString proto = m_currentURL.protocol();
+ TQString proto = m_currentURL.protocol();
if (m_currentURL.isLocalFile() ||
proto.startsWith("http") || proto.startsWith("webdav"))
{
@@ -212,12 +212,12 @@ void UAChangerPlugin::slotAboutToShow()
m_pUAMenu->popupMenu()->clear();
m_pUAMenu->popupMenu()->insertTitle(i18n("Identify As")); // imho title doesn't need colon..
- QString host = m_currentURL.isLocalFile() ? QFL1("localhost") : m_currentURL.host();
+ TQString host = m_currentURL.isLocalFile() ? QFL1("localhost") : m_currentURL.host();
m_currentUserAgent = KProtocolManager::userAgentForHost(host);
//kdDebug(90130) << "User Agent: " << m_currentUserAgent << endl;
int id = m_pUAMenu->popupMenu()->insertItem( i18n("Default Identification"), this,
- SLOT(slotDefault()), 0, ++count );
+ TQT_SLOT(slotDefault()), 0, ++count );
if( m_currentUserAgent == KProtocolManager::defaultUserAgent() )
m_pUAMenu->popupMenu()->setItemChecked(id, true);
@@ -230,7 +230,7 @@ void UAChangerPlugin::slotAboutToShow()
BrowserGroup::ConstIterator e = map.data().begin();
for( ; e != map.data().end(); ++e )
{
- int id = browserMenu->insertItem( m_lstAlias[*e], this, SLOT(slotItemSelected(int)), 0, *e );
+ int id = browserMenu->insertItem( m_lstAlias[*e], this, TQT_SLOT(slotItemSelected(int)), 0, *e );
if (m_lstIdentity[(*e)] == m_currentUserAgent)
browserMenu->setItemChecked(id, true);
}
@@ -241,16 +241,16 @@ void UAChangerPlugin::slotAboutToShow()
/* useless here, imho..
m_pUAMenu->popupMenu()->insertItem( i18n("Reload Identifications"), this,
- SLOT(slotReloadDescriptions()),
+ TQT_SLOT(slotReloadDescriptions()),
0, ++count );*/
m_pUAMenu->popupMenu()->insertItem( i18n("Apply to Entire Site"), this,
- SLOT(slotApplyToDomain()),
+ TQT_SLOT(slotApplyToDomain()),
0, ++count );
m_pUAMenu->popupMenu()->setItemChecked(count, m_bApplyToDomain);
m_pUAMenu->popupMenu()->insertItem( i18n("Configure..."), this,
- SLOT(slotConfigure()));
+ TQT_SLOT(slotConfigure()));
}
@@ -265,7 +265,7 @@ void UAChangerPlugin::slotItemSelected( int id )
{
if (m_lstIdentity[id] == m_currentUserAgent) return;
- QString host;
+ TQString host;
m_currentUserAgent = m_lstIdentity[id];
host = m_currentURL.isLocalFile() ? QFL1("localhost") : filterHost( m_currentURL.host() );
@@ -285,13 +285,13 @@ void UAChangerPlugin::slotDefault()
if( m_currentUserAgent == KProtocolManager::defaultUserAgent() ) return; // don't flicker!
// We have no choice but delete all higher domain level settings here since it
// affects what will be matched.
- QStringList partList = QStringList::split('.', m_currentURL.host(), false);
+ TQStringList partList = TQStringList::split('.', m_currentURL.host(), false);
if ( !partList.isEmpty() )
{
partList.remove(partList.begin());
- QStringList domains;
+ TQStringList domains;
// Remove the exact name match...
domains << m_currentURL.host ();
@@ -308,7 +308,7 @@ void UAChangerPlugin::slotDefault()
partList.remove(partList.begin());
}
- for (QStringList::Iterator it = domains.begin(); it != domains.end(); it++)
+ for (TQStringList::Iterator it = domains.begin(); it != domains.end(); it++)
{
//kdDebug () << "Domain to remove: " << *it << endl;
if ( m_config->hasGroup(*it) )
@@ -336,13 +336,13 @@ void UAChangerPlugin::slotDefault()
void UAChangerPlugin::updateIOSlaves ()
{
// Inform running http(s) io-slaves about the change...
- if (!DCOPRef("*", "KIO::Scheduler").send("reparseSlaveConfiguration", QString::null))
+ if (!DCOPRef("*", "KIO::Scheduler").send("reparseSlaveConfiguration", TQString::null))
kdWarning() << "UAChangerPlugin::updateIOSlaves: Unable to update running application!" << endl;
}
-QString UAChangerPlugin::filterHost(const QString &hostname)
+TQString UAChangerPlugin::filterHost(const TQString &hostname)
{
- QRegExp rx;
+ TQRegExp rx;
// Check for IPv4 address
rx.setPattern ("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}");
@@ -358,10 +358,10 @@ QString UAChangerPlugin::filterHost(const QString &hostname)
return (m_bApplyToDomain ? findTLD(hostname): hostname);
}
-QString UAChangerPlugin::findTLD (const QString &hostname)
+TQString UAChangerPlugin::findTLD (const TQString &hostname)
{
- QStringList domains;
- QStringList partList = QStringList::split('.', hostname, false);
+ TQStringList domains;
+ TQStringList partList = TQStringList::split('.', hostname, false);
if (partList.count())
partList.remove(partList.begin()); // Remove hostname
@@ -392,7 +392,7 @@ QString UAChangerPlugin::findTLD (const QString &hostname)
// Catch some TLDs that we miss with the previous check
// e.g. com.au, org.uk, mil.co
- QCString t = partList[0].lower().utf8();
+ TQCString t = partList[0].lower().utf8();
if ((t == "com") || (t == "net") || (t == "org") || (t == "gov") ||
(t == "edu") || (t == "mil") || (t == "int"))
break;