Qt3->TQt port

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/1/head
Mavridis Philippe 11 months ago
parent 47becbedc6
commit 2fbdf2c098
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -26,8 +26,8 @@
#include "altitemelement.h"
#include "altparser.h"
#include <qregexp.h>
#include <qstringlist.h>
#include <tqregexp.h>
#include <tqstringlist.h>
#include <klocale.h>
#include <kmessagebox.h>
@ -72,9 +72,9 @@ void AddAlternatives::slotOkClicked()
if (!m_textSlave->text().isEmpty())
{
QRegExp reg("\n");
QStringList slaveList = QStringList::split(reg, m_textSlave->text());
QStringList::Iterator it = slaveList.begin();
TQRegExp reg("\n");
TQStringList slaveList = TQStringList::split(reg, m_textSlave->text());
TQStringList::Iterator it = slaveList.begin();
for ( ; it != slaveList.end(); ++it )
{
a->addSlave(*it);
@ -92,12 +92,12 @@ void AddAlternatives::slotOkClicked()
m_treeItem->getAltController()->addAltItem(altItem);
QString priority;
TQString priority;
priority.setNum(a->getPriority());
altItem->setText( 1, priority);
altItem->setText( 2, a->getPath());
QString m_small_desc = altItem->getDescription();
TQString m_small_desc = altItem->getDescription();
if (!m_small_desc.isEmpty())
{

@ -40,7 +40,7 @@ public:
AddAlternatives(TreeItemElement *treeItem, Kalternatives *kalt, int countSlaves);
virtual ~AddAlternatives();
void addSlave(const QString& text){m_textSlave->append(text);}
void addSlave(const TQString& text){m_textSlave->append(text);}
protected slots:
void slotOkClicked();

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AddAlternativesUi</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>AddAlternatives</cstring>
</property>
@ -30,7 +30,7 @@
<property name="resizeMode">
<enum>Minimum</enum>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout6</cstring>
</property>
@ -44,7 +44,7 @@
<property name="spacing">
<number>0</number>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
</property>
@ -52,7 +52,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -67,7 +67,7 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout11</cstring>
</property>
@ -75,7 +75,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@ -155,7 +155,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout13</cstring>
</property>

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AddSlavesUi</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>AddSlaves</cstring>
</property>
@ -30,7 +30,7 @@
<property name="resizeMode">
<enum>Minimum</enum>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout13</cstring>
</property>
@ -44,7 +44,7 @@
<property name="spacing">
<number>0</number>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout12</cstring>
</property>
@ -52,7 +52,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -81,7 +81,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout13</cstring>
</property>

@ -35,7 +35,7 @@ AltController::~AltController()
void AltController::setBoutonOnOff(KListView *list, AltItemElement *altItem)
{
QListViewItemIterator it( list );
TQListViewItemIterator it( list );
AltItemElement *alt;
while ( it.current() )
{
@ -43,7 +43,7 @@ void AltController::setBoutonOnOff(KListView *list, AltItemElement *altItem)
{
if((alt!=altItem) && alt->isOn())
{
alt->setState(QCheckListItem::Off);
alt->setState(TQCheckListItem::Off);
}
}
++it;

@ -22,11 +22,11 @@
#define _ALTCONTROLLER_H_
#include <klistview.h>
#include <qptrlist.h>
#include <tqptrlist.h>
class AltItemElement;
typedef QPtrList<AltItemElement> AltItemList;
typedef TQPtrList<AltItemElement> AltItemList;
class AltController

@ -23,13 +23,13 @@
#include "altcontroller.h"
#include "altparser.h"
#include <qtimer.h>
#include <tqtimer.h>
#include <klocale.h>
#include <kdebug.h>
/******************************* AltItemElement ********************/
AltItemElement::AltItemElement(KListView *parent, Alternative *alternative)
: QCheckListItem(parent, "", QCheckListItem::RadioButton),
: TQCheckListItem(parent, "", TQCheckListItem::RadioButton),
m_alt(alternative),
m_parent(parent),
m_bisBroken(alternative->isBroken()),
@ -48,7 +48,7 @@ AltItemElement::~AltItemElement()
void AltItemElement::searchDescription()
{
QString exec = m_path;
TQString exec = m_path;
int posSlash = exec.findRev("/");
if (posSlash != -1)
@ -110,7 +110,7 @@ void AltItemElement::slotDescriptionTermined(KProcess *proc)
void AltItemElement::slotGetDescription(KProcess *, char *buffer, int buflen)
{
m_desc += QString::fromLatin1(buffer, buflen);
m_desc += TQString::fromLatin1(buffer, buflen);
}

@ -21,23 +21,23 @@
#ifndef _ALTITEMELEMENT_H_
#define _ALTITEMELEMENT_H_
#include <qlistview.h>
#include <tqlistview.h>
#include <klistview.h>
#include <qstring.h>
#include <tqstring.h>
#include <kprocess.h>
class Alternative;
class AltController;
class AltItemElement : public QObject, public QCheckListItem
class AltItemElement : public TQObject, public TQCheckListItem
{
Q_OBJECT
Alternative *m_alt;
KListView *m_parent;
bool m_bisBroken;
QString m_path;
QString m_desc;
TQString m_path;
TQString m_desc;
public:
AltItemElement(KListView *parent, Alternative *alternative );
@ -46,8 +46,8 @@ public:
bool isBroken() const { return m_bisBroken; }
KListView *getParent() const { return m_parent; }
Alternative *getAlternative() { return m_alt; }
QString getPath() const {return m_path; }
QString getDescription() const {return m_desc;}
TQString getPath() const {return m_path; }
TQString getDescription() const {return m_desc;}
void searchDescription();
private slots:

@ -19,10 +19,10 @@
***************************************************************************/
#include "altparser.h"
#include <qfileinfo.h>
#include <qfile.h>
#include <qdir.h>
#include <qstringlist.h>
#include <tqfileinfo.h>
#include <tqfile.h>
#include <tqdir.h>
#include <tqstringlist.h>
#include <unistd.h>
#include <string.h>
@ -31,7 +31,7 @@
Alternative::Alternative(Item *parentarg) : m_parent(parentarg)
{
m_priority = 1;
m_altSlaves = new QStringList;
m_altSlaves = new TQStringList;
}
// Copy constructor
@ -40,7 +40,7 @@ Alternative::Alternative(const Alternative &alt) :
m_priority(alt.getPriority()),
m_parent(alt.getParent())
{
m_altSlaves = new QStringList( *(alt.m_altSlaves) );
m_altSlaves = new TQStringList( *(alt.m_altSlaves) );
}
Alternative::~Alternative()
@ -56,12 +56,12 @@ Alternative& Alternative::operator=(const Alternative &alt)
m_altPath = alt.getPath();
m_priority = alt.getPriority();
m_parent = alt.getParent();
m_altSlaves = new QStringList( *(alt.m_altSlaves) );
m_altSlaves = new TQStringList( *(alt.m_altSlaves) );
}
return (*this);
}
void Alternative::setSlaves(QStringList *slaves)
void Alternative::setSlaves(TQStringList *slaves)
{
if(m_altSlaves) delete m_altSlaves;
m_altSlaves = slaves;
@ -70,7 +70,7 @@ void Alternative::setSlaves(QStringList *slaves)
bool Alternative::isSelected() const
{
if(m_parent->isBroken()) return false;
QFileInfo file("/etc/alternatives/"+m_parent->getName());
TQFileInfo file("/etc/alternatives/"+m_parent->getName());
if(!file.isSymLink()) return false;
if(file.readLink() == m_altPath) return 1;
return 0;
@ -79,7 +79,7 @@ bool Alternative::isSelected() const
bool Alternative::isBroken() const
{
return !QFile::exists(m_altPath);
return !TQFile::exists(m_altPath);
}
bool Alternative::select()
@ -88,23 +88,23 @@ bool Alternative::select()
if(isSelected()) return true;
if(isBroken())
{
m_selectError = QString("Broken alternative: Unexisting path %1").arg(m_altPath);
m_selectError = TQString("Broken alternative: Unexisting path %1").arg(m_altPath);
return false;
}
// Remove the current link:
QString parentPath = QString("/etc/alternatives/%1").arg(m_parent->getName());
QFile origlink(parentPath);
TQString parentPath = TQString("/etc/alternatives/%1").arg(m_parent->getName());
TQFile origlink(parentPath);
if(!origlink.remove())
{
m_selectError = QString("Could not delete alternative link %1: %2").arg(parentPath).arg(origlink.errorString());
m_selectError = TQString("Could not delete alternative link %1: %2").arg(parentPath).arg(origlink.errorString());
return false;
}
// Then we do the main link:
if(symlink(m_altPath.ascii(), parentPath.ascii()) == -1)
{
m_selectError = QString(strerror(errno));
m_selectError = TQString(strerror(errno));
return false;
}
@ -113,21 +113,21 @@ bool Alternative::select()
parslaves->setAutoDelete(1);
if(parslaves->count() == 0 || m_altSlaves->count() == 0) return true;
int count = 0;
QStringList::iterator sl;
TQStringList::iterator sl;
Slave *parsl;
for( sl = m_altSlaves->begin(); sl != m_altSlaves->end(); ++sl)
{
parsl = parslaves->at(count);
QString parstr = QString("/etc/alternatives/%1").arg(parsl->slname);
QFile parlink(parstr);
TQString parstr = TQString("/etc/alternatives/%1").arg(parsl->slname);
TQFile parlink(parstr);
if(!parlink.remove())
{
m_selectError = QString("Could not delete slave alternative link %1: %2").arg(parstr).arg(parlink.errorString());
m_selectError = TQString("Could not delete slave alternative link %1: %2").arg(parstr).arg(parlink.errorString());
return false;
}
if(symlink( (*sl).ascii(), parstr.ascii()) == -1)
{
m_selectError = QString(strerror(errno));
m_selectError = TQString(strerror(errno));
return false;
}
++count;
@ -239,7 +239,7 @@ void Item::setSlaves(SlaveList *slaves)
this->m_itemSlaves = slaves;
}
void Item::addSlave(const QString &namearg, const QString &patharg)
void Item::addSlave(const TQString &namearg, const TQString &patharg)
{
Slave *s = new Slave;
s->slname = namearg;
@ -247,9 +247,9 @@ void Item::addSlave(const QString &namearg, const QString &patharg)
m_itemSlaves->append(s);
}
void Item::delSlave(const QString &namearg)
void Item::delSlave(const TQString &namearg)
{
QPtrListIterator<Slave> it(*m_itemSlaves);
TQPtrListIterator<Slave> it(*m_itemSlaves);
Slave *s;
while( (s = it.current()) != 0)
@ -262,9 +262,9 @@ void Item::delSlave(const QString &namearg)
}
}
}
void Item::delSlaveByPath(const QString &patharg)
void Item::delSlaveByPath(const TQString &patharg)
{
QPtrListIterator<Slave> it(*m_itemSlaves);
TQPtrListIterator<Slave> it(*m_itemSlaves);
Slave *s;
while( (s = it.current()) != 0)
@ -278,7 +278,7 @@ void Item::delSlaveByPath(const QString &patharg)
}
}
Alternative *Item::getAlternative(const QString &altpath)
Alternative *Item::getAlternative(const TQString &altpath)
{
Alternative *a;
for(a = m_itemAlts->first(); a; a = m_itemAlts->next())
@ -298,9 +298,9 @@ void Item::setAlternatives(AltsPtrList &alts)
this->m_itemAlts = &alts;
}
void Item::delAlternativeByPath(const QString &patharg)
void Item::delAlternativeByPath(const TQString &patharg)
{
QPtrListIterator<Alternative> it(*m_itemAlts);
TQPtrListIterator<Alternative> it(*m_itemAlts);
Alternative *a;
while( (a = it.current()) != 0)
@ -316,7 +316,7 @@ void Item::delAlternativeByPath(const QString &patharg)
void Item::delAlternativeByPriority(int priorityarg)
{
QPtrListIterator<Alternative> it(*m_itemAlts);
TQPtrListIterator<Alternative> it(*m_itemAlts);
Alternative *a;
while( (a = it.current()) != 0)
@ -332,12 +332,12 @@ void Item::delAlternativeByPriority(int priorityarg)
bool Item::isBroken() const
{
return !QFile::exists(m_path);
return !TQFile::exists(m_path);
}
/********************** AltFIlesManager ************/
AltFilesManager::AltFilesManager(const QString &altdirarg) :
AltFilesManager::AltFilesManager(const TQString &altdirarg) :
m_altdir(altdirarg)
{
m_itemlist = new ItemPtrList;
@ -365,9 +365,9 @@ AltFilesManager::~AltFilesManager()
*/
}
Item* AltFilesManager::getItem(const QString &name) const
Item* AltFilesManager::getItem(const TQString &name) const
{
QPtrListIterator<Item> it(*m_itemlist);
TQPtrListIterator<Item> it(*m_itemlist);
Item *i;
while( (i = it.current()) != 0)
{
@ -381,17 +381,17 @@ Item* AltFilesManager::getItem(const QString &name) const
return NULL;
}
bool AltFilesManager::parseAltFiles(QString &errorstr)
bool AltFilesManager::parseAltFiles(TQString &errorstr)
{
QDir d(m_altdir);
QStringList fileList = d.entryList();
QStringList lines;
QFile altFile;
QString line, tmp;
TQDir d(m_altdir);
TQStringList fileList = d.entryList();
TQStringList lines;
TQFile altFile;
TQString line, tmp;
int nslaves;
unsigned int index, slavesend;
for( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it)
for( TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it)
{
Item *item = new Item;
if(*it == "." || *it == "..") {
@ -557,8 +557,8 @@ void AltFilesManager::debugPrintAlts() const
printf("\t\t\tNo slaves\n");
else
{
QStringList altslaves = *(a->getSlaves());
QStringList::iterator sl;
TQStringList altslaves = *(a->getSlaves());
TQStringList::iterator sl;
for( sl = altslaves.begin(); sl != altslaves.end(); ++sl)
{
printf("\t\t\t%s\n", (*sl).ascii());

@ -27,10 +27,10 @@
//
//Quitar el stdio.h
#include <qstring.h>
#include <qobject.h>
#include <qptrlist.h>
#include <qstringlist.h>
#include <tqstring.h>
#include <tqobject.h>
#include <tqptrlist.h>
#include <tqstringlist.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -40,17 +40,17 @@ class Item;
struct Slave
{
QString slname;
QString slpath;
TQString slname;
TQString slpath;
};
class Alternative
{
QString m_altPath;
QString m_selectError;
TQString m_altPath;
TQString m_selectError;
int m_priority;
Item *m_parent;
QStringList *m_altSlaves;
TQStringList *m_altSlaves;
public:
Alternative(Item *parentarg);
Alternative(const Alternative &alt);
@ -58,29 +58,29 @@ public:
Alternative& operator=(const Alternative &alt);
Item* getParent() const { return m_parent; }
QString getPath() const { return m_altPath; }
void setPath(const QString &patharg) { m_altPath = patharg; }
TQString getPath() const { return m_altPath; }
void setPath(const TQString &patharg) { m_altPath = patharg; }
int getPriority() const { return m_priority; }
void setPriority(int priorityarg) { m_priority = priorityarg; }
QStringList* getSlaves() const { return m_altSlaves; }
void setSlaves(QStringList *m_altSlaves);
void addSlave(const QString &slave) { m_altSlaves->append(slave); }
TQStringList* getSlaves() const { return m_altSlaves; }
void setSlaves(TQStringList *m_altSlaves);
void addSlave(const TQString &slave) { m_altSlaves->append(slave); }
uint countSlaves() const { return m_altSlaves->count(); }
QString getSlave(int pos) const { return *(m_altSlaves->at(pos)); }
TQString getSlave(int pos) const { return *(m_altSlaves->at(pos)); }
bool isSelected() const;
bool isBroken() const;
bool select();
QString getSelectError() const { return m_selectError; }
TQString getSelectError() const { return m_selectError; }
};
typedef QPtrList<Slave> SlaveList;
typedef QPtrList<Alternative> AltsPtrList;
typedef TQPtrList<Slave> SlaveList;
typedef TQPtrList<Alternative> AltsPtrList;
class Item
{
QString m_name;
QString m_mode;
QString m_path;
TQString m_name;
TQString m_mode;
TQString m_path;
SlaveList *m_itemSlaves;
AltsPtrList *m_itemAlts;
public:
@ -91,49 +91,49 @@ public:
Item& operator=(const Item &item);
Alternative* getSelected() const;
QString getName() const { return m_name; }
void setName(const QString &namearg) { m_name = namearg; }
QString getMode() const { return m_mode; }
TQString getName() const { return m_name; }
void setName(const TQString &namearg) { m_name = namearg; }
TQString getMode() const { return m_mode; }
//Check the input (FIXME)
void setMode(const QString &modearg) { m_mode = modearg; }
QString getPath() const { return m_path; }
void setPath(const QString &patharg) { m_path = patharg; }
void setMode(const TQString &modearg) { m_mode = modearg; }
TQString getPath() const { return m_path; }
void setPath(const TQString &patharg) { m_path = patharg; }
SlaveList *getSlaves() const { return m_itemSlaves; }
void setSlaves(SlaveList *slaves);
void addSlave(const QString &namearg, const QString &patharg);
void delSlave(const QString &namearg);
void delSlaveByPath(const QString &patharg);
void addSlave(const TQString &namearg, const TQString &patharg);
void delSlave(const TQString &namearg);
void delSlaveByPath(const TQString &patharg);
AltsPtrList *getAlternatives() const { return m_itemAlts; }
Alternative *getAlternative(const QString &altpath);
Alternative *getAlternative(const TQString &altpath);
void setAlternatives(AltsPtrList &alts);
int countAlternatives() const { return m_itemAlts->count(); }
void delAlternativeByPath(const QString &patharg);
void delAlternativeByPath(const TQString &patharg);
void delAlternativeByPriority(int priorityarg);
void addAlternative(Alternative *altarg) { m_itemAlts->append(altarg); }
bool isBroken() const;
};
typedef QPtrList<Item> ItemPtrList;
typedef TQPtrList<Item> ItemPtrList;
class AltFilesManager
{
ItemPtrList *m_itemlist;
QString m_altdir;
QString m_errorMsg;
TQString m_altdir;
TQString m_errorMsg;
bool m_parseOk;
bool parseAltFiles(QString &errorstr);
bool parseAltFiles(TQString &errorstr);
public:
AltFilesManager(const QString &altdir);
AltFilesManager(const TQString &altdir);
~AltFilesManager();
ItemPtrList* getGlobalAlternativeList() const { return this->m_itemlist; }
bool parsingOk() const { return m_parseOk; }
QString getErrorMsg() const { return m_errorMsg; }
Item* getItem (const QString &name) const;
TQString getErrorMsg() const { return m_errorMsg; }
Item* getItem (const TQString &name) const;
//FIXME: Put in a #ifdef
void debugPrintAlts() const;
QString getAltDir() { return m_altdir ;}
TQString getAltDir() { return m_altdir ;}
//protected:
//virtual int compareItems(Item i1, Item i2);
};

@ -30,32 +30,32 @@
#include "addalternatives.h"
#include "mainwindow.h"
#include <qtimer.h>
#include <tqtimer.h>
#include <kmessagebox.h>
#include <kaboutdialog.h>
#include <ktextedit.h>
#include <kdebug.h>
#include <klocale.h>
#include <qlayout.h>
#include <qfile.h>
#include <qtextstream.h>
#include <tqlayout.h>
#include <tqfile.h>
#include <tqtextstream.h>
#include <kgenericfactory.h>
#include <kstdguiitem.h>
#include <kdeversion.h>
typedef KGenericFactory<Kalternatives, QWidget> KalternativesFactory;
typedef KGenericFactory<Kalternatives, TQWidget> KalternativesFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_kalternatives, KalternativesFactory("kcmkalternatives"))
extern "C"
{
KCModule *create_kalternatives(QWidget *parent, const char *name)
KCModule *create_kalternatives(TQWidget *parent, const char *name)
{
return new Kalternatives(parent, name);
};
}
Kalternatives::Kalternatives(QWidget *parent, const char *name, const QStringList&)
Kalternatives::Kalternatives(TQWidget *parent, const char *name, const TQStringList&)
:KCModule(/*KalternativesFactory::instance(), */parent, name), myAboutData(0)
{
setUseRootOnlyMsg(false);
@ -80,12 +80,12 @@ m_mgr = new AltFilesManager("/var/lib/rpm/alternatives");
m_mgr = new AltFilesManager("/var/lib/dpkg/alternatives");
#else
KMessageBox::sorry(this, i18n("Kalternatives only work on Debian- or Mandrake-based systems"), i18n("Wrong System Type"));
QTimer::singleShot(0, this, SLOT(die()));
TQTimer::singleShot(0, this, SLOT(die()));
#endif
#endif
MainWindow *mainwindow = new MainWindow(this);
QBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
TQBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint());
layout->addWidget( mainwindow );
layout->activate();
@ -94,11 +94,11 @@ m_mgr = new AltFilesManager("/var/lib/rpm/alternatives");
connect(mainwindow->m_hideAlt, SIGNAL(clicked()), this,
SLOT(slotHideAlternativesClicked()));
connect(mainwindow->m_altList, SIGNAL(selectionChanged( QListViewItem* )), this,
SLOT(slotSelectAlternativesClicked(QListViewItem *)));
connect(mainwindow->m_altList, SIGNAL(selectionChanged( TQListViewItem* )), this,
SLOT(slotSelectAlternativesClicked(TQListViewItem *)));
connect(mainwindow->m_optionsList, SIGNAL(clicked(QListViewItem *)),
this, SLOT(slotOptionClicked(QListViewItem *)));
connect(mainwindow->m_optionsList, SIGNAL(clicked(TQListViewItem *)),
this, SLOT(slotOptionClicked(TQListViewItem *)));
connect(mainwindow->m_bAdd, SIGNAL(clicked()), this,
SLOT(slotAddClicked()));
connect(mainwindow->m_bDelete, SIGNAL(clicked()), this,
@ -161,7 +161,7 @@ void Kalternatives::die()
void Kalternatives::load()
{
clearList(m_altList);
QPtrList<Item> *itemslist = m_mgr->getGlobalAlternativeList();
TQPtrList<Item> *itemslist = m_mgr->getGlobalAlternativeList();
Item *i;
TreeItemElement *treeit;
for(i = itemslist->first(); i; i = itemslist->next())
@ -188,8 +188,8 @@ void Kalternatives::load()
void Kalternatives::clearList(KListView* list)
{
QListViewItemIterator it( list );
QListViewItem *tmp;
TQListViewItemIterator it( list );
TQListViewItem *tmp;
while( (tmp=it.current()) )
{
it++;
@ -198,7 +198,7 @@ void Kalternatives::clearList(KListView* list)
}
void Kalternatives::slotSelectAlternativesClicked(QListViewItem *alternative)
void Kalternatives::slotSelectAlternativesClicked(TQListViewItem *alternative)
{
clearList(m_optionsList);
TreeItemElement *treeItem;
@ -215,14 +215,14 @@ void Kalternatives::slotSelectAlternativesClicked(QListViewItem *alternative)
{
Alternative *a = altItem->getAlternative();
QString priority;
TQString priority;
priority.setNum(a->getPriority());
m_optionsList->insertItem(altItem);
altItem->setText( 1, priority);
altItem->setText( 2, a->getPath());
QString m_small_desc = altItem->getDescription();
TQString m_small_desc = altItem->getDescription();
if (!m_small_desc.isEmpty())
{
@ -243,9 +243,9 @@ void Kalternatives::slotHideAlternativesClicked()
{
if (m_hideAlt->isChecked ())
{
QListViewItemIterator it( m_altList );
TQListViewItemIterator it( m_altList );
TreeItemElement *i;
QListViewItem *tmp;
TQListViewItem *tmp;
while ( it.current() )
{
if((i = dynamic_cast<TreeItemElement *>(it.current())))
@ -269,7 +269,7 @@ void Kalternatives::slotHideAlternativesClicked()
}
void Kalternatives::slotOptionClicked(QListViewItem *option)
void Kalternatives::slotOptionClicked(TQListViewItem *option)
{
AltItemElement *altItem;
if((altItem = dynamic_cast<AltItemElement *>(option)))
@ -330,7 +330,7 @@ void Kalternatives::slotPropertiesClicked()
if((altItem = dynamic_cast<AltItemElement *>(m_optionsList->selectedItem())))
{
QString text;
TQString text;
PropertiesWindow *prop = new PropertiesWindow(this);
prop->bClose->setGuiItem(KStdGuiItem::close());
@ -341,10 +341,10 @@ void Kalternatives::slotPropertiesClicked()
text += i18n( "Path : %1\n" ).arg( a->getPath() );
text += i18n( "Priority : %1\n" ).arg( a->getPriority() );
QStringList* slavesList = a->getSlaves();
TQStringList* slavesList = a->getSlaves();
text += i18n( "Slave :", "Slaves :", slavesList->count() );
for ( QStringList::Iterator it = slavesList->begin(); it != slavesList->end(); ++it )
for ( TQStringList::Iterator it = slavesList->begin(); it != slavesList->end(); ++it )
{
text += "\n\t";
text += *it;
@ -357,7 +357,7 @@ void Kalternatives::slotPropertiesClicked()
void Kalternatives::save()
{
QListViewItemIterator it( m_altList );
TQListViewItemIterator it( m_altList );
TreeItemElement *treeItem;
while ( it.current() )
@ -366,11 +366,11 @@ void Kalternatives::save()
{
if(treeItem->isNbrAltChanged())
{
QString parentPath = QString("%1/%2")
TQString parentPath = TQString("%1/%2")
.arg(m_mgr->getAltDir())
.arg(treeItem->getName());
QFile origFile(parentPath);
TQFile origFile(parentPath);
if(origFile.exists())
{
origFile.remove();
@ -378,7 +378,7 @@ void Kalternatives::save()
if( origFile.open( IO_WriteOnly ))
{
QTextStream stream( &origFile );
TQTextStream stream( &origFile );
Item *item = treeItem->getItem();
@ -405,8 +405,8 @@ void Kalternatives::save()
stream << a->getPath() << endl;
stream << a->getPriority() << endl;
QStringList *slaveList = a->getSlaves();
QStringList::Iterator it = slaveList->begin();
TQStringList *slaveList = a->getSlaves();
TQStringList::Iterator it = slaveList->begin();
for ( ; it != slaveList->end(); ++it )
{
stream << *it << endl;
@ -446,7 +446,7 @@ void Kalternatives::configChanged()
}
QString Kalternatives::quickHelp() const
TQString Kalternatives::quickHelp() const
{
return i18n("<h1>Kalternatives</h1>\n"
"A Mandrake/Debian alternatives-system manager.");

@ -31,9 +31,9 @@
#include <klistview.h>
#include <kpushbutton.h>
#include <kcombobox.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <tqwidget.h>
#include <tqlabel.h>
#include <tqcheckbox.h>
#include <kcmodule.h>
#include <kaboutdata.h>
@ -50,31 +50,31 @@ class Kalternatives : public KCModule
KListView* m_optionsList;
KListView* m_altList;
KComboBox* m_statusCombo;
QLabel* m_altTilte;
QCheckBox* m_hideAlt;
TQLabel* m_altTilte;
TQCheckBox* m_hideAlt;
KAboutData *myAboutData;
void clearList(KListView* list);
public:
Kalternatives(QWidget *parent=0, const char *name=0, const QStringList& = QStringList() );
Kalternatives(TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() );
virtual ~Kalternatives();
KListView *optionsList() const {return m_optionsList;}
bool isBisRoot() const {return m_bisRoot;}
virtual void load();
virtual void save();
virtual QString quickHelp() const;
virtual TQString quickHelp() const;
virtual const KAboutData *aboutData()const { return myAboutData; };
public slots:
void configChanged();
private slots:
void slotSelectAlternativesClicked(QListViewItem *);
void slotSelectAlternativesClicked(TQListViewItem *);
void slotHideAlternativesClicked();
void die();
void slotOptionClicked(QListViewItem *option);
void slotOptionClicked(TQListViewItem *option);
void slotAddClicked();
void slotDeleteClicked();
void slotPropertiesClicked();

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>MainWindow</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>Kalternatives</cstring>
</property>
@ -33,14 +33,14 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QSplitter" row="0" column="0">
<widget class="TQSplitter" row="0" column="0">
<property name="name">
<cstring>splitter2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
</property>
@ -67,7 +67,7 @@
<enum>LastColumn</enum>
</property>
</widget>
<widget class="QGroupBox">
<widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@ -98,7 +98,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox" row="0" column="0">
<widget class="TQCheckBox" row="0" column="0">
<property name="name">
<cstring>m_hideAlt</cstring>
</property>
@ -121,7 +121,7 @@
</widget>
</vbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout24</cstring>
</property>
@ -129,7 +129,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout22</cstring>
</property>
@ -137,7 +137,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout5_2</cstring>
</property>
@ -145,7 +145,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -208,7 +208,7 @@
</size>
</property>
</spacer>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>m_altTilte</cstring>
</property>
@ -316,7 +316,7 @@
<bool>false</bool>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
</property>

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PropertiesWindow</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>PropertiesWindow</cstring>
</property>
@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout17</cstring>
</property>
@ -49,7 +49,7 @@
<enum>Horizontal</enum>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
</property>

@ -21,14 +21,14 @@
#include "treeitemelement.h"
#include "altparser.h"
#include "altcontroller.h"
#include <qfont.h>
#include <qpainter.h>
#include <tqfont.h>
#include <tqpainter.h>
#include <iostream>
using namespace std;
TreeItemElement::TreeItemElement(KListView *parent, Item *itemarg, AltController *altControl )
: QListViewItem(parent, itemarg->getName()),
: TQListViewItem(parent, itemarg->getName()),
m_item(itemarg),
m_name(itemarg->getName()),
m_changed(FALSE),
@ -42,29 +42,29 @@ TreeItemElement::~TreeItemElement()
{
}
void TreeItemElement::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
void TreeItemElement::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
QColor color;
TQColor color;
if (m_changed || m_nbrAltChanged)
{
color=QColor("red");
QFont f = p->font();
color=TQColor("red");
TQFont f = p->font();
f.setBold(true);
p->setFont(f);
}
// the pallet of colors is saved
QColorGroup _cg( cg );
QColor oldText=_cg.text();
TQColorGroup _cg( cg );
TQColor oldText=_cg.text();
// modification of the pallet of colors by defining
//our new color as color of text
_cg.setColor( QColorGroup::Text, color );
_cg.setColor( TQColorGroup::Text, color );
QListViewItem::paintCell( p, _cg, column, width, align );
TQListViewItem::paintCell( p, _cg, column, width, align );
// restoration of the pallet of "standard" colors
_cg.setColor( QColorGroup::Text, oldText );
_cg.setColor( TQColorGroup::Text, oldText );
}

@ -21,19 +21,19 @@
#ifndef _TREEITEMELEMENT_H_
#define _TREEITEMELEMENT_H_
#include <qstring.h>
#include <qptrlist.h>
#include <qlistview.h>
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqlistview.h>
#include <klistview.h>
class AltController;
class Item;
class TreeItemElement : public QListViewItem
class TreeItemElement : public TQListViewItem
{
Item *m_item;
QString m_name;
TQString m_name;
bool m_changed;
bool m_nbrAltChanged;
AltController *m_altControl;
@ -42,7 +42,7 @@ public:
TreeItemElement(KListView *parent, Item *itemarg, AltController *altControl);
~TreeItemElement();
QString getName() const { return m_name; }
TQString getName() const { return m_name; }
Item *getItem() const { return m_item; }
void setChanged(bool c) { m_changed = c; }
bool isChanged() const { return m_changed; }
@ -50,7 +50,7 @@ public:
bool isNbrAltChanged() const { return m_nbrAltChanged; }
AltController *getAltController() {return m_altControl;}
virtual void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align );
virtual void paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
};
#endif //_TREEITEMELEMENT_H_

Loading…
Cancel
Save