Browse Source

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

pull/1/head
Timothy Pearson 10 years ago
parent
commit
2a5a604bb4
  1. 2
      INDEX
  2. 4
      keep/app/addbackupwizard.cpp
  3. 2
      keep/app/backupconfigdialog.cpp
  4. 2
      keep/app/includeexcludedialog.cpp
  5. 2
      keep/app/keepmainwindow.cpp
  6. 4
      keep/common/rdblistener.cpp
  7. 4
      keep/common/rdblistener.h
  8. 82
      keep/common/rdbmanager.cpp
  9. 2
      keep/common/rdbmanager.h

2
INDEX

@ -12,7 +12,7 @@ following entries:
Entries should be entirely objective.
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
Synopsis: System log viewer tool for KDE

4
keep/app/addbackupwizard.cpp

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

2
keep/app/backupconfigdialog.cpp

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

2
keep/app/includeexcludedialog.cpp

@ -44,7 +44,7 @@ IncludeExcludeDialog::IncludeExcludeDialog(TQWidget *parent):KDialogBase(Plain,
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->includeExcludeList->setSorting(-1);

2
keep/app/keepmainwindow.cpp

@ -49,7 +49,7 @@ KeepMainWindow::KeepMainWindow(TQWidget *parent, const char *name): KMainWindow(
setCaption(i18n("Backup System"));
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_btnRestoreWizard->setPixmap(icons->loadIcon("restore_dir",KIcon::Toolbar,32));
m_actionView->m_btnForce->setPixmap(icons->loadIcon("force_backup",KIcon::Toolbar,32));

4
keep/common/rdblistener.cpp

@ -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_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);
}

4
keep/common/rdblistener.h

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

82
keep/common/rdbmanager.cpp

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

2
keep/common/rdbmanager.h

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

Loading…
Cancel
Save