Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 93f5eb3117
commit 604bf3f969

@ -42,7 +42,7 @@ namespace kt
void Group::setIconByName(const TQString & in)
{
icon_name = in;
icon = KGlobal::iconLoader()->loadIcon(in,KIcon::Small);
icon = TDEGlobal::iconLoader()->loadIcon(in,KIcon::Small);
}
void Group::rename(const TQString & nn)

@ -89,7 +89,7 @@ namespace kt
current_item = 0;
menu = 0;
createMenu(col);
save_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "groups";
save_file = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "groups";
GroupViewItem* all = addGroup(gman->allGroup(),0);
GroupViewItem* dwnld = addGroup(gman->downloadGroup(),all);
GroupViewItem* upld = addGroup(gman->uploadGroup(),all);
@ -105,7 +105,7 @@ namespace kt
addGroup(gman->activeUploadsGroup(), active);
custom_root = new KListViewItem(all,i18n("Custom Groups"));
custom_root->setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
custom_root->setPixmap(0,TDEGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setOpen(custom_root,true);
}

@ -26,7 +26,7 @@ namespace kt
TorrentDrag::TorrentDrag(TQWidget* src, const char *name) : TQStoredDrag("application/x-ktorrent-drag-object",src, name)
{
setPixmap(KGlobal::iconLoader()->loadIcon("player_playlist",KIcon::Small));
setPixmap(TDEGlobal::iconLoader()->loadIcon("player_playlist",KIcon::Small));
}

@ -132,7 +132,7 @@ KTorrent::KTorrent()
m_systray_icon = new TrayIcon(m_core, this);
m_group_view->loadGroups();
m_view_man->restoreViewState(KGlobal::config(),this);
m_view_man->restoreViewState(TDEGlobal::config(),this);
TQToolButton* tb = new TQToolButton(m_activeTabWidget);
tb->setIconSet(SmallIcon("tab_new"));
@ -215,8 +215,8 @@ KTorrent::KTorrent()
addToolWidget(m_group_view,"player_playlist",i18n("Groups"),DOCK_LEFT);
setAutoSaveSettings("WindowStatus",true);
KGlobal::config()->setGroup("WindowStatus");
bool hidden_on_exit = KGlobal::config()->readBoolEntry("hidden_on_exit",false);
TDEGlobal::config()->setGroup("WindowStatus");
bool hidden_on_exit = TDEGlobal::config()->readBoolEntry("hidden_on_exit",false);
if (Settings::showSystemTrayIcon())
{
if (hidden_on_exit)
@ -234,11 +234,11 @@ KTorrent::KTorrent()
show();
}
bool menubar_hidden = KGlobal::config()->readBoolEntry("menubar_hidden",false);
bool menubar_hidden = TDEGlobal::config()->readBoolEntry("menubar_hidden",false);
menuBar()->setHidden(menubar_hidden);
m_menubarAction->setChecked(!menubar_hidden);
bool statusbar_hidden = KGlobal::config()->readBoolEntry("statusbar_hidden",false);
bool statusbar_hidden = TDEGlobal::config()->readBoolEntry("statusbar_hidden",false);
statusBar()->setHidden(statusbar_hidden);
m_statusbarAction->setChecked(!statusbar_hidden);
@ -598,11 +598,11 @@ bool KTorrent::queryExit()
// stop timers to prevent update
m_gui_update_timer.stop();
KGlobal::config()->setGroup("WindowStatus");
KGlobal::config()->writeEntry("hidden_on_exit",this->isHidden());
KGlobal::config()->writeEntry("menubar_hidden",menuBar()->isHidden());
KGlobal::config()->writeEntry("statusbar_hidden",statusBar()->isHidden());
m_view_man->saveViewState(KGlobal::config());
TDEGlobal::config()->setGroup("WindowStatus");
TDEGlobal::config()->writeEntry("hidden_on_exit",this->isHidden());
TDEGlobal::config()->writeEntry("menubar_hidden",menuBar()->isHidden());
TDEGlobal::config()->writeEntry("statusbar_hidden",statusBar()->isHidden());
m_view_man->saveViewState(TDEGlobal::config());
saveSettings();
hide();
m_systray_icon->hide(); // hide system tray icon upon exit
@ -712,12 +712,12 @@ void KTorrent::optionsConfigureToolbars()
// use the standard toolbar editor
#if defined(TDE_MAKE_VERSION)
# if TDE_VERSION >= TDE_MAKE_VERSION(3,1,0)
saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
saveMainWindowSettings(TDEGlobal::config(), autoSaveGroup());
# else
saveMainWindowSettings(KGlobal::config());
saveMainWindowSettings(TDEGlobal::config());
# endif
#else
saveMainWindowSettings(KGlobal::config());
saveMainWindowSettings(TDEGlobal::config());
#endif
KEditToolbar dlg(factory());
connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(newToolbarConfig()));
@ -732,12 +732,12 @@ void KTorrent::newToolbarConfig()
#if defined(TDE_MAKE_VERSION)
# if TDE_VERSION >= TDE_MAKE_VERSION(3,1,0)
applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
applyMainWindowSettings(TDEGlobal::config(), autoSaveGroup());
# else
applyMainWindowSettings(KGlobal::config());
applyMainWindowSettings(TDEGlobal::config());
# endif
#else
applyMainWindowSettings(KGlobal::config());
applyMainWindowSettings(TDEGlobal::config());
#endif
}
@ -859,7 +859,7 @@ void KTorrent::addToolWidget(TQWidget* w,const TQString & icon,const TQString &
if (!icon.isNull())
w->setIcon(KGlobal::iconLoader()->loadIcon(icon,KIcon::Small));
w->setIcon(TDEGlobal::iconLoader()->loadIcon(icon,KIcon::Small));
switch (dock)
{

@ -48,7 +48,7 @@ int KTorrentApp::newInstance()
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
bt::Globals::instance().setDebugMode(args->isSet("debug"));
TQString data_dir = KGlobal::dirs()->saveLocation("data","ktorrent");
TQString data_dir = TDEGlobal::dirs()->saveLocation("data","ktorrent");
if (!data_dir.endsWith(bt::DirSeparator()))
data_dir += bt::DirSeparator();
bt::Globals::instance().initLog(data_dir + "log");

@ -77,7 +77,7 @@ KTorrentCore::KTorrentCore(kt::GUIInterface* gui) : max_downloads(0),keep_seedin
bool dd_not_exist = !bt::Exists(data_dir);
if (data_dir == TQString() || dd_not_exist)
{
data_dir = KGlobal::dirs()->saveLocation("data","ktorrent");
data_dir = TDEGlobal::dirs()->saveLocation("data","ktorrent");
if (dd_not_exist)
{
Settings::setTempDir(data_dir);
@ -139,7 +139,7 @@ KTorrentCore::~KTorrentCore()
void KTorrentCore::loadPlugins()
{
pman->loadConfigFile(KGlobal::dirs()->saveLocation("data","ktorrent") + "plugins");
pman->loadConfigFile(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "plugins");
pman->loadPluginList();
}

@ -160,8 +160,8 @@ QCStringList KTorrentViewItem::getTorrentInfo(kt::TorrentInterface* tc)
}
info.append(TQString::number(s.num_peers).local8Bit());
info.append(TQString(KGlobal::locale()->formatNumber(Percentage(s),2) + " %").local8Bit());
info.append(KGlobal::locale()->formatNumber(kt::ShareRatio(s),2).local8Bit());
info.append(TQString(TDEGlobal::locale()->formatNumber(Percentage(s),2) + " %").local8Bit());
info.append(TDEGlobal::locale()->formatNumber(kt::ShareRatio(s),2).local8Bit());
info.append(TQString::number(s.seeders_connected_to).local8Bit());
info.append(TQString::number(s.leechers_connected_to).local8Bit());
return info;
@ -252,13 +252,13 @@ void KTorrentViewItem::update()
if(m_parent->columnVisible(10))
{
setText(10,i18n("%1 %").arg(KGlobal::locale()->formatNumber(Percentage(s),2)));
setText(10,i18n("%1 %").arg(TDEGlobal::locale()->formatNumber(Percentage(s),2)));
}
if(m_parent->columnVisible(11))
{
float ratio = kt::ShareRatio(s);
setText(11,TQString("%1").arg(KGlobal::locale()->formatNumber(ratio,2)));
setText(11,TQString("%1").arg(TDEGlobal::locale()->formatNumber(ratio,2)));
}
if (m_parent->columnVisible(12))

@ -31,7 +31,7 @@ using namespace kt;
KTorrentViewMenu::KTorrentViewMenu (KTorrentView *parent, const char *name )
: KPopupMenu ( parent, name ),view(parent)
{
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
stop_id = insertItem(
iload->loadIconSet("ktstop",KIcon::Small),i18n("to stop", "Stop"),

@ -144,7 +144,7 @@ void KTorrentPreferences::removePrefPage(kt::PrefPageInterface* pp)
///////////////////////////////////////////////////////
DownloadPrefPage::DownloadPrefPage() : kt::PrefPageInterface(i18n("Downloads"), i18n("Download Options"), KGlobal::iconLoader()->loadIcon("down", KIcon::NoGroup)), dp(0)
DownloadPrefPage::DownloadPrefPage() : kt::PrefPageInterface(i18n("Downloads"), i18n("Download Options"), TDEGlobal::iconLoader()->loadIcon("down", KIcon::NoGroup)), dp(0)
{}
DownloadPrefPage::~ DownloadPrefPage()
@ -214,7 +214,7 @@ void DownloadPrefPage::deleteWidget()
//////////////////////////////////////
GeneralPrefPage::GeneralPrefPage() :
kt::PrefPageInterface(i18n("General"), i18n("General Options"),
KGlobal::iconLoader()->loadIcon("package_settings", KIcon::NoGroup)), gp(0)
TDEGlobal::iconLoader()->loadIcon("package_settings", KIcon::NoGroup)), gp(0)
{}
GeneralPrefPage::~GeneralPrefPage()
@ -338,7 +338,7 @@ void GeneralPrefPage::updateData()
if (Settings::tempDir() == TQString())
{
TQString data_dir = KGlobal::dirs()->saveLocation("data", "ktorrent");
TQString data_dir = TDEGlobal::dirs()->saveLocation("data", "ktorrent");
if (!data_dir.endsWith(bt::DirSeparator()))
data_dir += bt::DirSeparator();
@ -409,7 +409,7 @@ void GeneralPrefPage::deleteWidget()
AdvancedPrefPage::AdvancedPrefPage() :
kt::PrefPageInterface(i18n("Advanced"), i18n("Advanced Options"),
KGlobal::iconLoader()->loadIcon("package_settings", KIcon::NoGroup)), ap(0)
TDEGlobal::iconLoader()->loadIcon("package_settings", KIcon::NoGroup)), ap(0)
{}
AdvancedPrefPage::~AdvancedPrefPage()

@ -98,7 +98,7 @@ void QueueItem::paintCell(TQPainter* p,const TQColorGroup & cg,int column,int wi
QueueDialog::QueueDialog(bt::QueueManager* qm, TQWidget *parent, const char *name)
:QueueDlg(parent, name)
{
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
m_tabs->setTabIconSet(m_tabs->page(0), iload->loadIconSet("down", KIcon::Small));
m_tabs->setTabIconSet(m_tabs->page(1), iload->loadIconSet("up", KIcon::Small));

@ -159,7 +159,7 @@ void TrayIcon::maxShareRatioReached(kt::TorrentInterface* tc)
return;
const TorrentStats & s = tc->getStats();
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
double speed_up = (double)s.bytes_uploaded / 1024.0;
TQString msg = i18n("<b>%1</b> has reached its maximum share ratio of %2 and has been stopped."
@ -178,7 +178,7 @@ void TrayIcon::maxSeedTimeReached(kt::TorrentInterface* tc)
return;
const TorrentStats & s = tc->getStats();
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
double speed_up = (double)s.bytes_uploaded / 1024.0;
TQString msg = i18n("<b>%1</b> has reached its maximum seed time of %2 hours and has been stopped."
@ -223,7 +223,7 @@ void TrayIcon::queuingNotPossible(kt::TorrentInterface* tc)
const TorrentStats & s = tc->getStats();
TQString msg;
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
if (tc->overMaxRatio())
msg = i18n("<b>%1</b> has reached its maximum share ratio of %2 and cannot be enqueued. Remove the limit manually if you want to continue seeding.")

@ -36,7 +36,7 @@ Index: estimation-scripts/enable-logging.diff
-@@ -114,8 +119,43 @@
- setText(6,KBytesPerSecToString(tc->getUploadRate() / 1024.0));
-
- KLocale* loc = KGlobal::locale();
- KLocale* loc = TDEGlobal::locale();
-+
-+
-+ if(counter==1)
@ -145,7 +145,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp
@@ -114,8 +121,46 @@
setText(6,KBytesPerSecToString(s.upload_rate / 1024.0));
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
+
+
+

@ -30,7 +30,7 @@ namespace kt
{
TQString DataDir()
{
TQString str = KGlobal::dirs()->saveLocation("data","ktorrent");
TQString str = TDEGlobal::dirs()->saveLocation("data","ktorrent");
if (!str.endsWith(bt::DirSeparator()))
return str + bt::DirSeparator();
else

@ -39,7 +39,7 @@ namespace kt
{
parent = 0;
size = 0;
setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setPixmap(0,TDEGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setText(0,name);
setText(1,BytesToString(size));
setText(2,i18n("Yes"));
@ -53,7 +53,7 @@ namespace kt
name(name),parent(parent)
{
size = 0;
setPixmap(0,KGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setPixmap(0,TDEGlobal::iconLoader()->loadIcon("folder",KIcon::Small));
setText(0,name);
setText(1,BytesToString(size));
setText(2,i18n("Yes"));

@ -30,7 +30,7 @@ namespace kt
TQString BytesToString(Uint64 bytes,int precision)
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
if (bytes >= 1024 * 1024 * 1024)
return i18n("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
else if (bytes >= 1024*1024)
@ -43,13 +43,13 @@ namespace kt
TQString KBytesPerSecToString(double speed,int precision)
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
return i18n("%1 KB/s").arg(loc->formatNumber(speed,precision));
}
TQString DurationToString(Uint32 nsecs)
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
TQTime t;
int ndays = nsecs / 86400;
t = t.addSecs(nsecs % 86400);

@ -69,18 +69,18 @@ namespace kt
if (selected)
{
setPaletteBackgroundColor(KGlobalSettings::highlightColor());
setPaletteForegroundColor(KGlobalSettings::highlightedTextColor());
setPaletteBackgroundColor(TDEGlobalSettings::highlightColor());
setPaletteForegroundColor(TDEGlobalSettings::highlightedTextColor());
}
else if (odd)
{
setPaletteBackgroundColor(KGlobalSettings::baseColor());
setPaletteForegroundColor(KGlobalSettings::textColor());
setPaletteBackgroundColor(TDEGlobalSettings::baseColor());
setPaletteForegroundColor(TDEGlobalSettings::textColor());
}
else
{
setPaletteBackgroundColor(KGlobalSettings::alternateBackgroundColor());
setPaletteForegroundColor(KGlobalSettings::textColor());
setPaletteBackgroundColor(TDEGlobalSettings::alternateBackgroundColor());
setPaletteForegroundColor(TDEGlobalSettings::textColor());
}
}
@ -109,7 +109,7 @@ namespace kt
public:
LabelViewBox(TQWidget* parent) : TQWidget(parent)
{
setPaletteBackgroundColor(KGlobalSettings::baseColor());
setPaletteBackgroundColor(TDEGlobalSettings::baseColor());
layout = new TQVBoxLayout(this);
layout->setMargin(0);
}

@ -60,7 +60,7 @@ namespace kt
};
PluginManagerPrefPage::PluginManagerPrefPage(PluginManager* pman)
: PrefPageInterface(i18n("Plugins"), i18n("Plugin Options"),KGlobal::iconLoader()->loadIcon("ktplugins",KIcon::NoGroup)),pman(pman)
: PrefPageInterface(i18n("Plugins"), i18n("Plugin Options"),TDEGlobal::iconLoader()->loadIcon("ktplugins",KIcon::NoGroup)),pman(pman)
{
pmw = 0;
}

@ -70,7 +70,7 @@ namespace bt
else
{
// final log file is moved, now zip it and end the job
std::system(TQString("gzip " + KProcess::quote(file + "-1")).local8Bit());
std::system(TQString("gzip " + TDEProcess::quote(file + "-1")).local8Bit());
m_error = 0;
lg->logRotateDone();
emitResult();

@ -87,7 +87,7 @@ namespace bt
// move current log to 1 and zip it
bt::Move(file,file + "-1",true);
system(TQString("gzip " + KProcess::quote(file + "-1")).local8Bit());
system(TQString("gzip " + TDEProcess::quote(file + "-1")).local8Bit());
}
void setOutputFile(const TQString & file)

@ -185,7 +185,7 @@ namespace kt
percent = 0.0;
else if (percent > 100.0)
percent = 100.0;
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
it.current()->setText(4,i18n("%1 %").arg(loc->formatNumber(percent,2)));
}
}

@ -94,7 +94,7 @@ TQString kt::FloatSpinBox::mapValueToText( int value )
{
/// This is called from TQSpinBox, which passes an int.
/// As we don't use the TQSpinBox's internal value, we ignore it.
TQString t = KGlobal::locale()->formatNumber( m_value, m_precision_digits);
TQString t = TDEGlobal::locale()->formatNumber( m_value, m_precision_digits);
editor()->setText(t);
return t;
}
@ -104,7 +104,7 @@ int kt::FloatSpinBox::mapTextToValue( bool * ok )
/// This is called from TQSpinBox, which needs an int for return.
/// As we don't use the TQSpinBox's internal value, we only return 0.
float value = KGlobal::locale()->readNumber(text(), ok);
float value = TDEGlobal::locale()->readNumber(text(), ok);
if (*ok)
{
setValue(value);

@ -30,7 +30,7 @@ namespace kt
/**
* @author Jonas Widarsson
*
* A Spinbox for float values which respects KGlobal::locale().
* A Spinbox for float values which respects TDEGlobal::locale().
* TQSpinBox's internal integer value is only
* used for step detection.
*/

@ -83,17 +83,17 @@ namespace kt
getGUI()->addPrefPage(pref);
currentTorrentChanged(const_cast<kt::TorrentInterface*>(getGUI()->getCurrentTorrent()));
file_view->restoreLayout(KGlobal::config(),"FileView");
file_view->restoreLayout(TDEGlobal::config(),"FileView");
}
void InfoWidgetPlugin::unload()
{
if (cd_view)
cd_view->saveLayout(KGlobal::config(),"ChunkDownloadView");
cd_view->saveLayout(TDEGlobal::config(),"ChunkDownloadView");
if (peer_view)
peer_view->saveLayout(KGlobal::config(),"PeerView");
peer_view->saveLayout(TDEGlobal::config(),"PeerView");
if (file_view)
file_view->saveLayout(KGlobal::config(),"FileView");
file_view->saveLayout(TDEGlobal::config(),"FileView");
getGUI()->removeViewListener(this);
getGUI()->removePrefPage(pref);
@ -172,12 +172,12 @@ namespace kt
peer_view = new PeerView(0);
getGUI()->addToolWidget(peer_view,"tdmconfig",i18n("Peers"),GUIInterface::DOCK_BOTTOM);
peer_view->restoreLayout(KGlobal::config(),"PeerView");
peer_view->restoreLayout(TDEGlobal::config(),"PeerView");
createMonitor(tc);
}
else if (!show && peer_view)
{
peer_view->saveLayout(KGlobal::config(),"PeerView");
peer_view->saveLayout(TDEGlobal::config(),"PeerView");
getGUI()->removeToolWidget(peer_view);
delete peer_view; peer_view = 0;
createMonitor(tc);
@ -193,13 +193,13 @@ namespace kt
cd_view = new ChunkDownloadView(0);
getGUI()->addToolWidget(cd_view,"fifteenpieces",i18n("Chunks"),GUIInterface::DOCK_BOTTOM);
cd_view->restoreLayout(KGlobal::config(),"ChunkDownloadView");
cd_view->restoreLayout(TDEGlobal::config(),"ChunkDownloadView");
cd_view->changeTC(tc);
createMonitor(tc);
}
else if (!show && cd_view)
{
cd_view->saveLayout(KGlobal::config(),"ChunkDownloadView");
cd_view->saveLayout(TDEGlobal::config(),"ChunkDownloadView");
getGUI()->removeToolWidget(cd_view);
delete cd_view; cd_view = 0;
createMonitor(tc);

@ -31,7 +31,7 @@ namespace kt
{
InfoWidgetPrefPage::InfoWidgetPrefPage(InfoWidgetPlugin* iw)
: PrefPageInterface(i18n("Info Widget"),i18n("Information Widget Options"),KGlobal::iconLoader()->loadIcon("ktinfowidget",KIcon::NoGroup)),iw(iw)
: PrefPageInterface(i18n("Info Widget"),i18n("Information Widget Options"),TDEGlobal::iconLoader()->loadIcon("ktinfowidget",KIcon::NoGroup)),iw(iw)
{
pref = 0;
}

@ -91,7 +91,7 @@ namespace kt
percent = 0.0;
else if (percent > 100.0)
percent = 100.0;
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
setText(4,i18n("%1 %").arg(loc->formatNumber(percent,2)));
perc_complete = percent;
}

@ -26,7 +26,7 @@
kt::LocaleFloatValidator::LocaleFloatValidator( TQObject * parent, const char * name )
:TQValidator(parent, name)
{
TQString decimalPoint = TQRegExp::escape(KGlobal::locale()->decimalSymbol());
TQString decimalPoint = TQRegExp::escape(TDEGlobal::locale()->decimalSymbol());
regexp.setPattern("^-?\\d*(" + decimalPoint + "\\d*)?$");
}

@ -65,7 +65,7 @@ namespace kt
{
if (!yes_no_pix_loaded)
{
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
/* Prefer builtin flag images to the ones provided by KDE */
flagDB.addFlagSource("data", TQString("ktorrent/geoip/%1.png"));
flagDB.addFlagSource("locale", TQString("l10n/%1/flag.png"));
@ -155,7 +155,7 @@ namespace kt
void PeerViewItem::update()
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
const PeerInterface::Stats & s = peer->getStats();
if (s.download_rate >= 103) // lowest "visible" speed, all below will be 0,0 Kb/s
@ -246,8 +246,8 @@ namespace kt
setShowSortIndicator(true);
menu = new KPopupMenu(this);
kick_id = menu->insertItem(KGlobal::iconLoader()->loadIcon("delete_user", KIcon::NoGroup), i18n("to kick", "Kick peer"));
ban_id = menu->insertItem(KGlobal::iconLoader()->loadIcon("filter",KIcon::NoGroup), i18n("to ban", "Ban peer"));
kick_id = menu->insertItem(TDEGlobal::iconLoader()->loadIcon("delete_user", KIcon::NoGroup), i18n("to kick", "Kick peer"));
ban_id = menu->insertItem(TDEGlobal::iconLoader()->loadIcon("filter",KIcon::NoGroup), i18n("to ban", "Ban peer"));
connect(this,TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint& )),
this,TQT_SLOT(showContextMenu(KListView*, TQListViewItem*, const TQPoint& )));

@ -151,7 +151,7 @@ namespace kt
if(!maxRatio->hasFocus() && useLimit->isChecked())
maxRatioUpdate();
m_share_ratio->setText(TQString("<font color=\"%1\">%2</font>").arg(ratio <= 0.8 ? "#ff0000" : "#1c9a1c").arg(KGlobal::locale()->formatNumber(ratio,2)));
m_share_ratio->setText(TQString("<font color=\"%1\">%2</font>").arg(ratio <= 0.8 ? "#ff0000" : "#1c9a1c").arg(TDEGlobal::locale()->formatNumber(ratio,2)));
Uint32 secs = curr_tc->getRunningTimeUL();
if (secs == 0)

@ -46,7 +46,7 @@ namespace kt
TrackerView::TrackerView(TQWidget *parent, const char *name)
:TrackerViewBase(parent, name), tc(0)
{
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
btnUpdate->setIconSet(iload->loadIconSet("apply", KIcon::Small));
btnAdd->setIconSet(iload->loadIconSet("add", KIcon::Small));
btnRemove->setIconSet(iload->loadIconSet("remove", KIcon::Small));

@ -101,7 +101,7 @@ namespace kt
void AntiP2P::load()
{
file = new MMapFile();
if(! file->open(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", MMapFile::READ) )
if(! file->open(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", MMapFile::READ) )
{
Out(SYS_IPF|LOG_NOTICE) << "Anti-p2p file not loaded." << endl;
file = 0;

@ -87,14 +87,14 @@ namespace kt
void ConvertDialog::convert()
{
TQFile source( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.txt" );
TQFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" );
TQFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp" );
TQFile source( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.txt" );
TQFile target( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" );
TQFile temp( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp" );
if(target.exists())
{
//make backup
KIO::NetAccess::file_copy(KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", -1, true);
KIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", -1, true);
}
/* READ INPUT FILE */
@ -238,14 +238,14 @@ namespace kt
{
if(converting)
{
TQFile target( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" );
TQFile target( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat" );
if(target.exists())
target.remove();
TQFile temp( KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp");
TQFile temp( TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp");
if(temp.exists())
{
KIO::NetAccess::file_copy(KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", KGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", -1, true);
KIO::NetAccess::file_copy(TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat.tmp", TDEGlobal::dirs() ->saveLocation( "data", "ktorrent" ) + "level1.dat", -1, true);
temp.remove();
}

@ -89,7 +89,7 @@ namespace kt
if(checkUseLevel1->isChecked())
{
TQFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat");
TQFile target(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat");
if(target.exists())
lbl_status1->setText(i18n("Status: Loaded and running."));
else
@ -101,12 +101,12 @@ namespace kt
void IPBlockingPrefPageWidget::btnDownload_clicked()
{
TQString target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1");
TQString target(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1");
TQFile target_file(target);
TQFile txtfile(target + ".txt");
KURL url(m_url->url());
KURL dest(target);
KURL temp(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp");
KURL temp(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp");
if(KIO::NetAccess::exists(temp,false, this))
KIO::NetAccess::del(temp,this);
@ -188,13 +188,13 @@ namespace kt
void IPBlockingPrefPageWidget::convert()
{
TQFile target(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat");
TQFile target(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat");
if(target.exists())
{
if((KMessageBox::questionYesNo(this,i18n("Filter file (level1.dat) already exists, do you want to convert it again?"),i18n("File Exists")) == 4))
return;
// else
// KIO::NetAccess::del(KGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
// KIO::NetAccess::del(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
}
ConvertDialog dlg(m_plugin);
dlg.exec();
@ -220,7 +220,7 @@ namespace kt
////////////////////////////////////////////////////////////////////////////////////
IPBlockingPrefPage::IPBlockingPrefPage(CoreInterface* core, IPFilterPlugin* p)
: PrefPageInterface(i18n("IPBlocking Filter"), i18n("IPBlocking Filter Options"), KGlobal::iconLoader()->loadIcon("filter",KIcon::NoGroup)), m_core(core), m_plugin(p)
: PrefPageInterface(i18n("IPBlocking Filter"), i18n("IPBlocking Filter Options"), TDEGlobal::iconLoader()->loadIcon("filter",KIcon::NoGroup)), m_core(core), m_plugin(p)
{
widget = 0;
}

@ -29,7 +29,7 @@ namespace kt
LogPrefPage::LogPrefPage()
: PrefPageInterface(i18n("LogViewer"), i18n("LogViewer Options"),
KGlobal::iconLoader()->loadIcon("toggle_log",KIcon::NoGroup))
TDEGlobal::iconLoader()->loadIcon("toggle_log",KIcon::NoGroup))
{
m_widget = 0;
}

@ -51,10 +51,10 @@ namespace kt
setMaxLogLines(200);
setMinimumSize(TQSize(0,50));
setSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
KGlobal::config()->setGroup("LogViewer");
if (KGlobal::config()->hasKey("LogViewerWidgetSize"))
TDEGlobal::config()->setGroup("LogViewer");
if (TDEGlobal::config()->hasKey("LogViewerWidgetSize"))
{
TQSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0);
TQSize s = TDEGlobal::config()->readSizeEntry("LogViewerWidgetSize",0);
resize(s);
}
@ -64,8 +64,8 @@ namespace kt
LogViewer::~LogViewer()
{
KGlobal::config()->setGroup("LogViewer");
KGlobal::config()->writeEntry("LogViewerWidgetSize",size());
TDEGlobal::config()->setGroup("LogViewer");
TDEGlobal::config()->writeEntry("LogViewerWidgetSize",size());
LogFlags::instance().setLog(0);
}

@ -179,12 +179,12 @@ void OutputRetriever::retrieveData(const KURL &url)
d->buffer->open(IO_WriteOnly);
d->process = new KShellProcess();
connect(d->process, TQT_SIGNAL(processExited(KProcess *)),
TQT_SLOT(slotExited(KProcess *)));
connect(d->process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
TQT_SLOT(slotOutput(KProcess *, char *, int)));
connect(d->process, TQT_SIGNAL(processExited(TDEProcess *)),
TQT_SLOT(slotExited(TDEProcess *)));
connect(d->process, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)),
TQT_SLOT(slotOutput(TDEProcess *, char *, int)));
*d->process << url.path();
d->process->start(KProcess::NotifyOnExit, KProcess::Stdout);
d->process->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout);
}
int OutputRetriever::errorCode() const
@ -192,12 +192,12 @@ int OutputRetriever::errorCode() const
return d->lastError;
}
void OutputRetriever::slotOutput(KProcess *, char *data, int length)
void OutputRetriever::slotOutput(TDEProcess *, char *data, int length)
{
d->buffer->writeBlock(data, length);
}
void OutputRetriever::slotExited(KProcess *p)
void OutputRetriever::slotExited(TDEProcess *p)
{
if (!p->normalExit())
d->lastError = p->exitStatus();

@ -21,7 +21,7 @@ namespace KIO
{
class Job;
}
class KProcess;
class TDEProcess;
namespace RSS
{
@ -192,8 +192,8 @@ namespace RSS
virtual void abort() {}
private slots:
void slotOutput(KProcess *process, char *data, int length);
void slotExited(KProcess *process);
void slotOutput(TDEProcess *process, char *data, int length);
void slotExited(TDEProcess *process);
private:
OutputRetriever(const OutputRetriever &other);

@ -181,8 +181,8 @@ namespace kt
TQString RssFeed::getFilename()
{
TQDir directory;
directory.mkdir(KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds");
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).replace("/", "_").replace(":", "_") + ".ktr";
directory.mkdir(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds");
return TDEGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).replace("/", "_").replace(":", "_") + ".ktr";
}

@ -1082,12 +1082,12 @@ namespace kt
TQString RssFeedManager::getFeedListFilename()
{
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds.ktr";
return TDEGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds.ktr";
}
TQString RssFeedManager::getFilterListFilename()
{
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfilters.ktr";
return TDEGlobal::dirs()->saveLocation("data","ktorrent") + "rssfilters.ktr";
}
void RssFeedManager::saveFeedList()

@ -61,7 +61,7 @@ namespace kt
void RssFeedPlugin::load()
{
//add the new tab to the gui
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
m_rssFeedManager = new RssFeedManager(getCore());
getGUI()->addTabPage(
m_rssFeedManager,iload->loadIconSet("player_playlist", KIcon::Small),

@ -32,7 +32,7 @@ namespace kt
ScanFolderPrefPage::ScanFolderPrefPage(ScanFolderPlugin* plugin)
: PrefPageInterface(i18n("ScanFolder"), i18n("ScanFolder Options"),
KGlobal::iconLoader()->loadIcon("view_sidetree",KIcon::NoGroup)), m_plugin(plugin)
TDEGlobal::iconLoader()->loadIcon("view_sidetree",KIcon::NoGroup)), m_plugin(plugin)
{}

@ -222,7 +222,7 @@ namespace kt
void BWScheduler::loadSchedule()
{
TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule");
TQFile file(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule");
if(!file.exists())
return;
@ -256,7 +256,7 @@ namespace kt
void BWScheduler::saveSchedule()
{
TQFile file(KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule");
TQFile file(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule");
file.open(IO_WriteOnly);
TQDataStream stream(&file);

@ -53,7 +53,7 @@ namespace kt
lblStatus->clear();
pix_icon->setPixmap(KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup));
pix_icon->setPixmap(TDEGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup));
btnOk->setGuiItem(KStdGuiItem::ok());
btnCancel->setGuiItem(KStdGuiItem::cancel());
@ -211,7 +211,7 @@ namespace kt
void BWSPrefPageWidget::loadDefault()
{
//read schedule from HD
TQString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule";
TQString fn = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "bwschedule";
loadSchedule(fn, false);
}

@ -32,7 +32,7 @@ namespace kt
{
SchedulerPrefPage::SchedulerPrefPage(SchedulerPlugin* plugin)
: PrefPageInterface(i18n("Scheduler"), i18n("Scheduler plugin options"), KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup)), m_plugin(plugin)
: PrefPageInterface(i18n("Scheduler"), i18n("Scheduler plugin options"), TDEGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup)), m_plugin(plugin)
{
widget = 0;
}

@ -62,7 +62,7 @@ namespace kt
void SearchPlugin::load()
{
engines.load(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
engines.load(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
KToolBar* tb = getGUI()->addToolBar("search");
tab = new SearchTab(tb);
connect(tab,TQT_SIGNAL(search( const TQString&, int, bool )),
@ -113,7 +113,7 @@ namespace kt
return;
}
KIconLoader* iload = KGlobal::iconLoader();
KIconLoader* iload = TDEGlobal::iconLoader();
SearchWidget* search = new SearchWidget(this);
getGUI()->addTabPage(search,iload->loadIconSet("viewmag", KIcon::Small),text,this);
@ -128,7 +128,7 @@ namespace kt
void SearchPlugin::preferencesUpdated()
{
engines.load(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
engines.load(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
if (tab)
tab->updateSearchEngines(engines);

@ -99,7 +99,7 @@ namespace kt
void SearchPrefPageWidget::saveSearchEngines()
{
TQFile fptr(KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
TQFile fptr(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines");
if (!fptr.open(IO_WriteOnly))
return;
TQTextStream out(&fptr);
@ -185,7 +185,7 @@ namespace kt
void SearchPrefPageWidget::btnUpdate_clicked()
{
TQString fn = KGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines.tmp";
TQString fn = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "search_engines.tmp";
KURL source("http://www.ktorrent.org/downloads/search_engines");
if (KIO::NetAccess::download(source,fn,NULL))
@ -245,7 +245,7 @@ namespace kt
SearchPrefPage::SearchPrefPage(SearchPlugin* plugin)
: PrefPageInterface(i18n("a noun", "Search"), i18n("Search Engine Options"),
KGlobal::iconLoader()->loadIcon("viewmag",KIcon::NoGroup)), m_plugin(plugin)
TDEGlobal::iconLoader()->loadIcon("viewmag",KIcon::NoGroup)), m_plugin(plugin)
{
widget = 0;
}

@ -67,11 +67,11 @@ namespace kt
right_click_menu = new KPopupMenu(this);
right_click_menu->insertSeparator();
back_id = right_click_menu->insertItem(
KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
TDEGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
? "forward" : "back",KIcon::Small),
i18n("Back"),html_part,TQT_SLOT(back()));
right_click_menu->insertItem(
KGlobal::iconLoader()->loadIconSet("reload",KIcon::Small),
TDEGlobal::iconLoader()->loadIconSet("reload",KIcon::Small),
i18n("Reload"),html_part,TQT_SLOT(reload()));
right_click_menu->setItemEnabled(back_id,false);
@ -83,13 +83,13 @@ namespace kt
connect(sbar->m_reload,TQT_SIGNAL(clicked()),html_part,TQT_SLOT(reload()));
sbar->m_clear_button->setIconSet(
KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
TDEGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
? "clear_left" : "locationbar_erase",KIcon::Small));
sbar->m_back->setIconSet(
KGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
TDEGlobal::iconLoader()->loadIconSet(TQApplication::reverseLayout()
? "forward" : "back", KIcon::Small));
sbar->m_reload->setIconSet(
KGlobal::iconLoader()->loadIconSet("reload",KIcon::Small));
TDEGlobal::iconLoader()->loadIconSet("reload",KIcon::Small));
connect(html_part,TQT_SIGNAL(backAvailable(bool )),

@ -22,7 +22,7 @@
namespace kt {
StatsPluginPrefs::StatsPluginPrefs() : PrefPageInterface(i18n("Statistics"), i18n("Statistics options"), KGlobal::iconLoader()->loadIcon("ktimemon",KIcon::NoGroup)), pmUi(0)
StatsPluginPrefs::StatsPluginPrefs() : PrefPageInterface(i18n("Statistics"), i18n("Statistics options"), TDEGlobal::iconLoader()->loadIcon("ktimemon",KIcon::NoGroup)), pmUi(0)
{
}

@ -59,12 +59,12 @@ namespace kt
void UPnPPlugin::load()
{
//KIconLoader* iload = KGlobal::iconLoader();
//KIconLoader* iload = TDEGlobal::iconLoader();
sock = new UPnPMCastSocket();
pref = new UPnPPrefPage(sock);
this->getGUI()->addPrefPage(pref);
// load the routers list
TQString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers";
TQString routers_file = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "routers";
if (bt::Exists(routers_file))
sock->loadRouters(routers_file);
sock->discover();
@ -72,7 +72,7 @@ namespace kt
void UPnPPlugin::unload()
{
TQString routers_file = KGlobal::dirs()->saveLocation("data","ktorrent") + "routers";
TQString routers_file = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "routers";
sock->saveRouters(routers_file);
this->getGUI()->removePrefPage(pref);
sock->close();

@ -28,7 +28,7 @@
namespace kt
{
UPnPPrefPage::UPnPPrefPage(UPnPMCastSocket* sock): PrefPageInterface(i18n("UPnP"), i18n("UPnP Devices"),KGlobal::iconLoader()->loadIcon("ktupnp",KIcon::NoGroup)),sock(sock)
UPnPPrefPage::UPnPPrefPage(UPnPMCastSocket* sock): PrefPageInterface(i18n("UPnP"), i18n("UPnP Devices"),TDEGlobal::iconLoader()->loadIcon("ktupnp",KIcon::NoGroup)),sock(sock)
{
widget = 0;
}

@ -155,7 +155,7 @@ namespace kt
if (!ret)
{
Out(SYS_PNP|LOG_IMPORTANT) << "Error parsing router description !" << endl;
TQString dest = KGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure";
TQString dest = TDEGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure";
KIO::file_copy(target,dest,-1,true,false,false);
}
else

@ -58,7 +58,7 @@ namespace kt
php_i = new PhpInterface(core);
clients.setAutoDelete(true);
TQStringList dirList = KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www");
TQStringList dirList = TDEGlobal::instance()->dirs()->findDirs("data", "ktorrent/www");
rootDir = *(dirList.begin());
Out(SYS_WEB|LOG_DEBUG) << "WWW Root Directory "<< rootDir <<endl;
session.logged_in = false;

@ -46,7 +46,7 @@ namespace kt
TQString BytesToString2(Uint64 bytes,int precision = 2)
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
if (bytes >= 1024 * 1024 * 1024)
return TQString("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
else if (bytes >= 1024*1024)
@ -59,7 +59,7 @@ namespace kt
TQString KBytesPerSecToString2(double speed,int precision = 2)
{
KLocale* loc = KGlobal::locale();
KLocale* loc = TDEGlobal::locale();
return TQString("%1 KB/s").arg(loc->formatNumber(speed,precision));
}

@ -25,7 +25,7 @@ namespace kt
WebInterfacePrefPage::WebInterfacePrefPage(WebInterfacePlugin* plugin)
: PrefPageInterface(i18n("WebInterface"), i18n("WebInterface Options"),
KGlobal::iconLoader()->loadIcon("toggle_log",KIcon::NoGroup))
TDEGlobal::iconLoader()->loadIcon("toggle_log",KIcon::NoGroup))
{
m_widget = 0;
w_plugin=plugin;

@ -50,7 +50,7 @@ WebInterfacePrefWidget::WebInterfacePrefWidget(TQWidget *parent, const char *nam
forward->setChecked(WebInterfacePluginSettings::forward());
sessionTTL->setValue(WebInterfacePluginSettings::sessionTTL());
TQStringList dirList=KGlobal::instance()->dirs()->findDirs("data", "ktorrent/www");
TQStringList dirList=TDEGlobal::instance()->dirs()->findDirs("data", "ktorrent/www");
TQDir d(*(dirList.begin()));
TQStringList skinList=d.entryList(TQDir::Dirs);
for ( TQStringList::Iterator it = skinList.begin(); it != skinList.end(); ++it ){

Loading…
Cancel
Save