From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kicker/extensions/dockbar/dockbarextension.cpp | 62 +++++++++++++------------- kicker/extensions/dockbar/dockbarextension.h | 22 ++++----- kicker/extensions/dockbar/dockcontainer.cpp | 26 +++++------ kicker/extensions/dockbar/dockcontainer.h | 30 ++++++------- 4 files changed, 70 insertions(+), 70 deletions(-) (limited to 'kicker/extensions/dockbar') diff --git a/kicker/extensions/dockbar/dockbarextension.cpp b/kicker/extensions/dockbar/dockbarextension.cpp index 71b583f35..d3b625f80 100644 --- a/kicker/extensions/dockbar/dockbarextension.cpp +++ b/kicker/extensions/dockbar/dockbarextension.cpp @@ -44,7 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern "C" { - KDE_EXPORT KPanelExtension* init(QWidget *parent, const QString& configFile) + KDE_EXPORT KPanelExtension* init(TQWidget *parent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("dockbarextension"); return new DockBarExtension(configFile, KPanelExtension::Normal, @@ -52,15 +52,15 @@ extern "C" } } -DockBarExtension::DockBarExtension(const QString& configFile, Type type, - int actions, QWidget *parent, const char *name) +DockBarExtension::DockBarExtension(const TQString& configFile, Type type, + int actions, TQWidget *parent, const char *name) : KPanelExtension(configFile, type, actions, parent, name) { dragging_container = 0; kwin_module = new KWinModule(this); - connect( kwin_module, SIGNAL( windowAdded(WId) ), SLOT( windowAdded(WId) ) ); + connect( kwin_module, TQT_SIGNAL( windowAdded(WId) ), TQT_SLOT( windowAdded(WId) ) ); setMinimumSize(DockContainer::sz(), DockContainer::sz()); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); loadContainerConfig(); } @@ -77,15 +77,15 @@ DockBarExtension::~DockBarExtension() if (dragging_container) delete dragging_container; } -QSize DockBarExtension::sizeHint(Position p, QSize) const +TQSize DockBarExtension::sizeHint(Position p, TQSize) const { if (p == Left || p == Right) - return QSize(DockContainer::sz(), DockContainer::sz() * containers.count()); + return TQSize(DockContainer::sz(), DockContainer::sz() * containers.count()); else - return QSize(DockContainer::sz() * containers.count(), DockContainer::sz()); + return TQSize(DockContainer::sz() * containers.count(), DockContainer::sz()); } -void DockBarExtension::resizeEvent(QResizeEvent*) +void DockBarExtension::resizeEvent(TQResizeEvent*) { layoutContainers(); } @@ -96,7 +96,7 @@ void DockBarExtension::windowAdded(WId win) // try to read WM_COMMAND int argc; char **argv; - QString command; + TQString command; if (XGetCommand(qt_xdisplay(), win, &argv, &argc)) { command = KShell::joinArgs(argv, argc); XFreeStringList(argv); @@ -145,7 +145,7 @@ void DockBarExtension::windowAdded(WId win) // try to read class hint XClassHint hint; - QString resClass, resName; + TQString resClass, resName; if (XGetClassHint(qt_xdisplay(), win, &hint)) { resName = hint.res_name; resClass = hint.res_class; @@ -182,7 +182,7 @@ void DockBarExtension::layoutContainers() } } -void DockBarExtension::embedWindow(WId win, QString command, QString resName, QString resClass) +void DockBarExtension::embedWindow(WId win, TQString command, TQString resName, TQString resClass) { if (win == 0) return; DockContainer* container = 0; @@ -204,7 +204,7 @@ void DockBarExtension::embedWindow(WId win, QString command, QString resName, QS } if (container == 0) { - QString cmd = command.isNull() ? resClass : command; + TQString cmd = command.isNull() ? resClass : command; if (KStandardDirs::findExe(KShell::splitArgs(cmd).front()).isEmpty()) ncmd = true; container = new DockContainer(cmd, this, resName, resClass); @@ -236,10 +236,10 @@ void DockBarExtension::addContainer(DockContainer* c, int pos) containers.insert(it, c); } - connect(c, SIGNAL(embeddedWindowDestroyed(DockContainer*)), - SLOT(embeddedWindowDestroyed(DockContainer*))); - connect(c, SIGNAL(settingsChanged(DockContainer*)), - SLOT(settingsChanged(DockContainer*))); + connect(c, TQT_SIGNAL(embeddedWindowDestroyed(DockContainer*)), + TQT_SLOT(embeddedWindowDestroyed(DockContainer*))); + connect(c, TQT_SIGNAL(settingsChanged(DockContainer*)), + TQT_SLOT(settingsChanged(DockContainer*))); c->resize(DockContainer::sz(), DockContainer::sz()); c->show(); } @@ -272,7 +272,7 @@ void DockBarExtension::settingsChanged(DockContainer *) void DockBarExtension::saveContainerConfig() { - QStringList applet_list; + TQStringList applet_list; KConfig *conf = config(); unsigned count = 0; @@ -283,7 +283,7 @@ void DockBarExtension::saveContainerConfig() DockContainer* c = *it; if (!c->command().isEmpty()) { - QString applet_gid = QString("Applet_%1").arg(QString::number(count)); + TQString applet_gid = TQString("Applet_%1").arg(TQString::number(count)); applet_list.append(applet_gid); conf->setGroup(applet_gid); conf->writePathEntry("Command", c->command()); @@ -302,15 +302,15 @@ void DockBarExtension::loadContainerConfig() { KConfig *conf = config(); conf->setGroup("General"); - QStringList applets = conf->readListEntry("Applets"); + TQStringList applets = conf->readListEntry("Applets"); - QStringList fail_list; - for (QStringList::Iterator it = applets.begin(); it != applets.end(); ++it) { + TQStringList fail_list; + for (TQStringList::Iterator it = applets.begin(); it != applets.end(); ++it) { if (!conf->hasGroup(*it)) continue; conf->setGroup(*it); - QString cmd = conf->readPathEntry("Command"); - QString resName = conf->readPathEntry("resName"); - QString resClass = conf->readEntry("resClass"); + TQString cmd = conf->readPathEntry("Command"); + TQString resName = conf->readPathEntry("resName"); + TQString resClass = conf->readEntry("resClass"); if (cmd.isEmpty() || resName.isEmpty() || resClass.isEmpty()) continue; DockContainer* c = new DockContainer(cmd, this, resName, resClass ); @@ -328,7 +328,7 @@ void DockBarExtension::loadContainerConfig() saveContainerConfig(); } -int DockBarExtension::findContainerAtPoint(const QPoint& p) +int DockBarExtension::findContainerAtPoint(const TQPoint& p) { int i = 0; for (DockContainer::Vector::const_iterator it = containers.constBegin(); @@ -344,7 +344,7 @@ int DockBarExtension::findContainerAtPoint(const QPoint& p) return -1; } -void DockBarExtension::mousePressEvent(QMouseEvent *e ) { +void DockBarExtension::mousePressEvent(TQMouseEvent *e ) { if (e->button() == LeftButton) { // Store the position of the mouse clic. mclic_pos = e->pos(); @@ -354,7 +354,7 @@ void DockBarExtension::mousePressEvent(QMouseEvent *e ) { } } -void DockBarExtension::mouseReleaseEvent(QMouseEvent *e ) { +void DockBarExtension::mouseReleaseEvent(TQMouseEvent *e ) { if (e->button() != LeftButton) return; if (dragging_container) { releaseMouse(); @@ -365,11 +365,11 @@ void DockBarExtension::mouseReleaseEvent(QMouseEvent *e ) { } } -void DockBarExtension::mouseMoveEvent(QMouseEvent *e) { +void DockBarExtension::mouseMoveEvent(TQMouseEvent *e) { if (! (e->state() & LeftButton) ) return; if (dragging_container == 0) { // Check whether the user has moved far enough. - int delay = QApplication::startDragDistance(); + int delay = TQApplication::startDragDistance(); if ( (mclic_pos - e->pos()).manhattanLength() > delay ) { int pos = findContainerAtPoint(e->pos()); original_container = 0; @@ -388,7 +388,7 @@ void DockBarExtension::mouseMoveEvent(QMouseEvent *e) { dragging_container->move(e->globalPos() - mclic_dock_pos); // change layout of other containers - QPoint dragpos(dragging_container->pos()), + TQPoint dragpos(dragging_container->pos()), barpos(mapToGlobal(pos())); int pdrag1,pdrag2,psz; pdrag1 = dragpos.x() - barpos.x() + DockContainer::sz()/2; diff --git a/kicker/extensions/dockbar/dockbarextension.h b/kicker/extensions/dockbar/dockbarextension.h index 0003ec6fa..e735ec708 100644 --- a/kicker/extensions/dockbar/dockbarextension.h +++ b/kicker/extensions/dockbar/dockbarextension.h @@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __dockbarextension_h__ #define __dockbarextension_h__ -#include +#include #include #include "dockcontainer.h" @@ -35,12 +35,12 @@ class DockBarExtension : public KPanelExtension Q_OBJECT public: - DockBarExtension(const QString& configFile, Type t = Normal, - int actions = 0, QWidget *parent = 0, const char *name = 0); + DockBarExtension(const TQString& configFile, Type t = Normal, + int actions = 0, TQWidget *parent = 0, const char *name = 0); virtual ~DockBarExtension(); - QSize sizeHint(Position, QSize maxSize) const; + TQSize sizeHint(Position, TQSize maxSize) const; Position preferedPosition() const { return Right; } protected slots: @@ -49,24 +49,24 @@ protected slots: void settingsChanged(DockContainer*); protected: - void resizeEvent(QResizeEvent*); - void embedWindow(WId win, QString command, QString resName, QString resClass); + void resizeEvent(TQResizeEvent*); + void embedWindow(WId win, TQString command, TQString resName, TQString resClass); void addContainer(DockContainer*, int pos=-1); void removeContainer(DockContainer*); void saveContainerConfig(); void loadContainerConfig(); void layoutContainers(); - int findContainerAtPoint(const QPoint&); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); + int findContainerAtPoint(const TQPoint&); + void mousePressEvent(TQMouseEvent *); + void mouseReleaseEvent(TQMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); private: KWinModule* kwin_module; DockContainer::Vector containers; // handle the dragging of applets DockContainer *dragging_container, *original_container; - QPoint mclic_pos, mclic_dock_pos; + TQPoint mclic_pos, mclic_dock_pos; int dragged_container_original_pos; }; diff --git a/kicker/extensions/dockbar/dockcontainer.cpp b/kicker/extensions/dockbar/dockcontainer.cpp index f2117346d..d363b6b30 100644 --- a/kicker/extensions/dockbar/dockcontainer.cpp +++ b/kicker/extensions/dockbar/dockcontainer.cpp @@ -21,10 +21,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -38,9 +38,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include -DockContainer::DockContainer( QString command, QWidget *parent, - QString resname, QString resclass, bool undocked_style ) - : QFrame( parent, resname.ascii(), +DockContainer::DockContainer( TQString command, TQWidget *parent, + TQString resname, TQString resclass, bool undocked_style ) + : TQFrame( parent, resname.ascii(), undocked_style ? WStyle_Customize | WStyle_StaysOnTop | WStyle_Tool | WStyle_NoBorder | WX11BypassWM : 0 ), @@ -64,7 +64,7 @@ DockContainer::DockContainer( QString command, QWidget *parent, if (!undocked_style) { setFrameStyle(StyledPanel | Raised); setLineWidth(border()); - QToolTip::add(this, command); + TQToolTip::add(this, command); } else { setFrameStyle(StyledPanel | Plain); setLineWidth(1); @@ -76,7 +76,7 @@ void DockContainer::embed( WId id ) { if( id == _embeddedWinId || id == 0) return; - QRect geom = KWin::windowInfo(id,NET::WMKDEFrameStrut).frameGeometry(); + TQRect geom = KWin::windowInfo(id,NET::WMKDEFrameStrut).frameGeometry(); // does the same as KWM::prepareForSwallowing() XWithdrawWindow( qt_xdisplay(), id, qt_xscreen() ); @@ -147,10 +147,10 @@ bool DockContainer::x11Event( XEvent *e ) void DockContainer::askNewCommand(bool bad_command) { bool ok; - QString title( i18n("Enter Command Line for Applet %1.%2").arg(resName()).arg(resClass()) ); - QString description( i18n("This applet does not behave correctly and the dockbar was unable to " + TQString title( i18n("Enter Command Line for Applet %1.%2").arg(resName()).arg(resClass()) ); + TQString description( i18n("This applet does not behave correctly and the dockbar was unable to " "find the command line necessary to launch it the next time KDE starts up") ); - QString cmd; + TQString cmd; /* I was not able to figure out why valgrind complains inside the getText call.. @@ -160,13 +160,13 @@ void DockContainer::askNewCommand(bool bad_command) cmd = KInputDialog::getText( title, description, command(), &ok, this ); } else { - cmd = KInputDialog::getText( title, QString::null, + cmd = KInputDialog::getText( title, TQString::null, command(), &ok, this ); } if (ok) { _command = cmd; emit settingsChanged(this); } } -void DockContainer::popupMenu(QPoint p) +void DockContainer::popupMenu(TQPoint p) { int r; { diff --git a/kicker/extensions/dockbar/dockcontainer.h b/kicker/extensions/dockbar/dockcontainer.h index bc9962290..d1968fa28 100644 --- a/kicker/extensions/dockbar/dockcontainer.h +++ b/kicker/extensions/dockbar/dockcontainer.h @@ -24,19 +24,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __dockcontainer_h__ #define __dockcontainer_h__ -#include -#include +#include +#include class DockContainer : public QFrame { Q_OBJECT public: - typedef QValueVector Vector; + typedef TQValueVector Vector; - DockContainer( QString command, QWidget *parent, - QString resname, - QString resclass, + DockContainer( TQString command, TQWidget *parent, + TQString resname, + TQString resclass, bool undocked_style=false); void embed(WId); @@ -44,11 +44,11 @@ public: void kill(); WId embeddedWinId() const; - QString command() const; - QString resClass() const; - QString resName() const; + TQString command() const; + TQString resClass() const; + TQString resName() const; void askNewCommand(bool bad_command=true); - void popupMenu(QPoint p); + void popupMenu(TQPoint p); static int& sz(); static int& border(); signals: @@ -60,8 +60,8 @@ protected: private: WId _embeddedWinId; - QString _command; - QString _resName, _resClass; + TQString _command; + TQString _resName, _resClass; }; @@ -70,17 +70,17 @@ inline WId DockContainer::embeddedWinId() const return _embeddedWinId; } -inline QString DockContainer::command() const +inline TQString DockContainer::command() const { return _command; } -inline QString DockContainer::resClass() const +inline TQString DockContainer::resClass() const { return _resClass; } -inline QString DockContainer::resName() const +inline TQString DockContainer::resName() const { return _resName; } -- cgit v1.2.1