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

pull/1/head
Timothy Pearson 12 years ago
parent 20e841e256
commit 2a5a604bb4

@ -12,7 +12,7 @@ following entries:
Entries should be entirely objective. Entries should be entirely objective.
Name: kextprocess Name: kextprocess
Synopsis: Library with a KProcess-like API for running apps remotely via e.g. SSH Synopsis: Library with a TDEProcess-like API for running apps remotely via e.g. SSH
Name: ksystemlog Name: ksystemlog
Synopsis: System log viewer tool for KDE Synopsis: System log viewer tool for KDE

@ -97,7 +97,7 @@ void AddBackupWizard::setupPage1()
addBackupWizard1View = new AddBackupWizard1View(page1,"addBackupWizard1View"); addBackupWizard1View = new AddBackupWizard1View(page1,"addBackupWizard1View");
addBackupWizard1View->source->setMode(KFile::Directory); addBackupWizard1View->source->setMode(KFile::Directory);
KIconLoader *icons = KGlobal::iconLoader(); KIconLoader *icons = TDEGlobal::iconLoader();
addBackupWizard1View->includeExclude->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16)); addBackupWizard1View->includeExclude->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16));
addPage( page1, "Directory to backup" ); addPage( page1, "Directory to backup" );
@ -122,7 +122,7 @@ void AddBackupWizard::setupPage3()
page3->setMargin(0); page3->setMargin(0);
addBackupWizard3View = new AddBackupWizard3View(page3,"addBackupWizard3View"); addBackupWizard3View = new AddBackupWizard3View(page3,"addBackupWizard3View");
KIconLoader *icons = KGlobal::iconLoader(); KIconLoader *icons = TDEGlobal::iconLoader();
addBackupWizard3View->advancedConfig->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16)); addBackupWizard3View->advancedConfig->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16));
addPage( page3, "Backup options" ); addPage( page3, "Backup options" );

@ -43,7 +43,7 @@
BackupConfigDialog::BackupConfigDialog(TQWidget *parent):KDialogBase(Plain, i18n("Configure backups"), BackupConfigDialog::BackupConfigDialog(TQWidget *parent):KDialogBase(Plain, i18n("Configure backups"),
Help|Cancel|Ok, Cancel, parent, "configBackups", true, false) Help|Cancel|Ok, Cancel, parent, "configBackups", true, false)
{ {
KIconLoader *icons = KGlobal::iconLoader(); KIconLoader *icons = TDEGlobal::iconLoader();
TQFrame *page = plainPage(); TQFrame *page = plainPage();

@ -44,7 +44,7 @@ IncludeExcludeDialog::IncludeExcludeDialog(TQWidget *parent):KDialogBase(Plain,
topLayout->addWidget( m_view,0,0 ); topLayout->addWidget( m_view,0,0 );
KIconLoader *icons = KGlobal::iconLoader(); KIconLoader *icons = TDEGlobal::iconLoader();
m_view->remove->setPixmap(icons->loadIcon("remove",KIcon::Toolbar,22)); m_view->remove->setPixmap(icons->loadIcon("remove",KIcon::Toolbar,22));
m_view->includeExcludeList->setSorting(-1); m_view->includeExcludeList->setSorting(-1);

@ -49,7 +49,7 @@ KeepMainWindow::KeepMainWindow(TQWidget *parent, const char *name): KMainWindow(
setCaption(i18n("Backup System")); setCaption(i18n("Backup System"));
m_actionView = new ActionView(this); m_actionView = new ActionView(this);
KIconLoader *icons = KGlobal::iconLoader(); KIconLoader *icons = TDEGlobal::iconLoader();
m_actionView->m_btnAddWizard->setPixmap(icons->loadIcon("add_backup",KIcon::Toolbar,32)); m_actionView->m_btnAddWizard->setPixmap(icons->loadIcon("add_backup",KIcon::Toolbar,32));
m_actionView->m_btnRestoreWizard->setPixmap(icons->loadIcon("restore_dir",KIcon::Toolbar,32)); m_actionView->m_btnRestoreWizard->setPixmap(icons->loadIcon("restore_dir",KIcon::Toolbar,32));
m_actionView->m_btnForce->setPixmap(icons->loadIcon("force_backup",KIcon::Toolbar,32)); m_actionView->m_btnForce->setPixmap(icons->loadIcon("force_backup",KIcon::Toolbar,32));

@ -24,13 +24,13 @@ RDBListener::RDBListener()
} }
void RDBListener::receivedStdErr(KProcess *proc, char *buffer, int buflen) void RDBListener::receivedStdErr(TDEProcess *proc, char *buffer, int buflen)
{ {
m_isOk = false; m_isOk = false;
m_stdErr.append(buffer); m_stdErr.append(buffer);
} }
void RDBListener::receivedStdOut(KProcess *proc, char *buffer, int buflen) void RDBListener::receivedStdOut(TDEProcess *proc, char *buffer, int buflen)
{ {
m_stdOut.append(buffer); m_stdOut.append(buffer);
} }

@ -36,8 +36,8 @@ public:
bool isOk(); bool isOk();
public slots: public slots:
void receivedStdOut(KProcess *proc, char *buffer, int buflen); void receivedStdOut(TDEProcess *proc, char *buffer, int buflen);
void receivedStdErr(KProcess *proc, char *buffer, int buflen); void receivedStdErr(TDEProcess *proc, char *buffer, int buflen);
private: private:
TQStringList m_stdOut; TQStringList m_stdOut;

@ -53,18 +53,18 @@ void RDBManager::slotForceBackup(TQValueList<Backup> backupList)
TQString RDBManager::compareAtTime(Backup backup, TQDateTime date) TQString RDBManager::compareAtTime(Backup backup, TQDateTime date)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--compare-at-time"; *proc << "--compare-at-time";
*proc << TQString::number(date.toTime_t()); // increment date *proc << TQString::number(date.toTime_t()); // increment date
// Adds source and dest // Adds source and dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.source()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.source())));
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
// Adds the listener // Adds the listener
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList output = listen->stdOut(); TQStringList output = listen->stdOut();
@ -81,17 +81,17 @@ TQString RDBManager::compareAtTime(Backup backup, TQDateTime date)
TQString RDBManager::listChangedSince(Backup backup, TQDateTime date) TQString RDBManager::listChangedSince(Backup backup, TQDateTime date)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--list-changed-since"; *proc << "--list-changed-since";
*proc << TQString::number(date.toTime_t()); // increment date *proc << TQString::number(date.toTime_t()); // increment date
// Adds the dest // Adds the dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
// Adds a listener // Adds a listener
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList output = listen->stdOut(); TQStringList output = listen->stdOut();
@ -108,17 +108,17 @@ TQString RDBManager::listChangedSince(Backup backup, TQDateTime date)
TQString RDBManager::listAtTime(Backup backup, TQDateTime date) TQString RDBManager::listAtTime(Backup backup, TQDateTime date)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--list-at-time"; *proc << "--list-at-time";
*proc << TQString::number(date.toTime_t()); // increment date *proc << TQString::number(date.toTime_t()); // increment date
// Adds the dest // Adds the dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
// Adds a listener // Adds a listener
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList output = listen->stdOut(); TQStringList output = listen->stdOut();
@ -135,18 +135,18 @@ TQString RDBManager::listAtTime(Backup backup, TQDateTime date)
TQValueList<TQDateTime> RDBManager::incrementList(Backup backup) TQValueList<TQDateTime> RDBManager::incrementList(Backup backup)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--list-increments"; *proc << "--list-increments";
*proc << "-v2"; *proc << "-v2";
*proc << "--parsable-output"; *proc << "--parsable-output";
// Adds the dest // Adds the dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
// Adds a listener // Adds a listener
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList output = listen->stdOut(); TQStringList output = listen->stdOut();
@ -204,20 +204,20 @@ TQValueList<Backup> RDBManager::outdatedBackupList()
void RDBManager::slotRestoreBackup(Backup backup,TQDateTime time) void RDBManager::slotRestoreBackup(Backup backup,TQDateTime time)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--force"; *proc << "--force";
*proc << "--restore-as-of"; *proc << "--restore-as-of";
*proc << TQString::number(time.toTime_t()); // Date of the increment to restore *proc << TQString::number(time.toTime_t()); // Date of the increment to restore
// Adds source and dest // Adds source and dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.source()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.source())));
// Adds a listener (for output recording) // Adds a listener (for output recording)
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
connect(proc,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdErr(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStderr(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdErr(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
kdDebug() << "Executed process: " << proc->args() << endl; kdDebug() << "Executed process: " << proc->args() << endl;
@ -235,13 +235,13 @@ void RDBManager::slotRestoreBackup(Backup backup,TQDateTime time)
bool RDBManager::isRDB() bool RDBManager::isRDB()
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
*proc << "-V"; *proc << "-V";
// Adds a listener (for output recording) // Adds a listener (for output recording)
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList outList = listen->stdOut(); TQStringList outList = listen->stdOut();
@ -260,13 +260,13 @@ bool RDBManager::isRDB()
TQString RDBManager::RDBVersion() TQString RDBManager::RDBVersion()
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
*proc << "-V"; *proc << "-V";
// Adds a listener (for output recording) // Adds a listener (for output recording)
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
TQStringList outList = listen->stdOut(); TQStringList outList = listen->stdOut();
@ -283,7 +283,7 @@ TQString RDBManager::RDBVersion()
void RDBManager::doBackup(Backup backup) void RDBManager::doBackup(Backup backup)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(KeepSettings::controlRDBPriority,KeepSettings::rDBPriority()); TDEProcess *proc = RDBProcess(KeepSettings::controlRDBPriority,KeepSettings::rDBPriority());
// Adds include and exclude // Adds include and exclude
if ( backup.useIncludeExclude() ) if ( backup.useIncludeExclude() )
{ {
@ -296,12 +296,12 @@ void RDBManager::doBackup(Backup backup)
if ( type == "I" ) if ( type == "I" )
{ {
*proc << "--include"; *proc << "--include";
*proc << TQString(TQFile::encodeName(KProcess::quote(file))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(file)));
} }
else if ( type == "E" ) else if ( type == "E" )
{ {
*proc << "--exclude"; *proc << "--exclude";
*proc << TQString(TQFile::encodeName(KProcess::quote(file))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(file)));
} }
} }
} }
@ -325,14 +325,14 @@ void RDBManager::doBackup(Backup backup)
} }
} }
// Adds source and dest // Adds source and dest
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.source()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.source())));
*proc << TQString(TQFile::encodeName(KProcess::quote(backup.dest()))); *proc << TQString(TQFile::encodeName(TDEProcess::quote(backup.dest())));
// Adds a listener (for output recording) // Adds a listener (for output recording)
RDBListener *listen = new RDBListener(); RDBListener *listen = new RDBListener();
connect(proc,TQT_SIGNAL(receivedStdout(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStdout(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdOut(TDEProcess *,char *,int)));
connect(proc,TQT_SIGNAL(receivedStderr(KProcess *,char *,int)),listen,TQT_SLOT(receivedStdErr(KProcess *,char *,int))); connect(proc,TQT_SIGNAL(receivedStderr(TDEProcess *,char *,int)),listen,TQT_SLOT(receivedStdErr(TDEProcess *,char *,int)));
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
kdDebug() << "Executed process: " << proc->args() << endl; kdDebug() << "Executed process: " << proc->args() << endl;
@ -358,13 +358,13 @@ void RDBManager::doBackup(Backup backup)
void RDBManager::removeOldIncrements(Backup backup) void RDBManager::removeOldIncrements(Backup backup)
{ {
// Gets the rdiff-backup process // Gets the rdiff-backup process
KProcess *proc = RDBProcess(); TDEProcess *proc = RDBProcess();
// Adds the options // Adds the options
*proc << "--remove-older-than" << TQString("%1").arg(backup.deleteAfter()) + "D"; *proc << "--remove-older-than" << TQString("%1").arg(backup.deleteAfter()) + "D";
// Adds dest // Adds dest
*proc << backup.dest(); *proc << backup.dest();
// Starts the process // Starts the process
if ( !proc->start(KProcess::Block, KProcess::AllOutput) ) if ( !proc->start(TDEProcess::Block, TDEProcess::AllOutput) )
kdDebug() << "Error starting rdiff-backup" << endl; kdDebug() << "Error starting rdiff-backup" << endl;
kdDebug() << "Executed process: " << proc->args() << endl; kdDebug() << "Executed process: " << proc->args() << endl;
@ -372,9 +372,9 @@ void RDBManager::removeOldIncrements(Backup backup)
delete proc; delete proc;
} }
KProcess *RDBManager::RDBProcess(bool isNice,int niceLevel) TDEProcess *RDBManager::RDBProcess(bool isNice,int niceLevel)
{ {
KProcess *proc = new KProcess(); TDEProcess *proc = new TDEProcess();
proc->setUseShell(true); proc->setUseShell(true);
if ( isNice ) if ( isNice )
{ {

@ -57,7 +57,7 @@ signals:
private: private:
void doBackup(Backup backup); void doBackup(Backup backup);
void removeOldIncrements(Backup backup); void removeOldIncrements(Backup backup);
KProcess * RDBProcess(bool isNice=false,int niceLevel=0); TDEProcess * RDBProcess(bool isNice=false,int niceLevel=0);
}; };
#endif #endif

Loading…
Cancel
Save