summaryrefslogtreecommitdiffstats
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
commit7a741e43ff09e70396a918956219b8316c48e522 (patch)
tree3d0f60eccd59786cea7236db2d5c4c1f25874515 /src/dolphincontextmenu.cpp
parenta48487ef0c329434b58b6f920111bb0999f1109e (diff)
downloaddolphin-7a741e43ff09e70396a918956219b8316c48e522.tar.gz
dolphin-7a741e43ff09e70396a918956219b8316c48e522.zip
TQt4 port Dolphin
This enables compilation under Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/dolphin@1229359 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 7ac2a56..be433ea 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -26,7 +26,7 @@
#include <ktrader.h>
#include <klocale.h>
#include <krun.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
@@ -44,10 +44,10 @@
#include "dolphinsettings.h"
-DolphinContextMenu::DolphinContextMenu(DolphinView* parent,
+DolphinContextMenu::DolphinContextMenu(DolphinView* tqparent,
KFileItem* fileInfo,
- const QPoint& pos) :
- m_dolphinView(parent),
+ const TQPoint& pos) :
+ m_dolphinView(tqparent),
m_fileInfo(fileInfo),
m_pos(pos)
{
@@ -93,7 +93,7 @@ void DolphinContextMenu::openViewportContextMenu()
KAction* action = 0;
- QPtrListIterator<KAction> fileGrouptIt(dolphin.fileGroupActions());
+ TQPtrListIterator<KAction> fileGrouptIt(dolphin.fileGroupActions());
while ((action = fileGrouptIt.current()) != 0) {
action->plug(createNewMenu);
++fileGrouptIt;
@@ -104,14 +104,14 @@ void DolphinContextMenu::openViewportContextMenu()
//
//createNewMenu->insertSeparator();
//
- //QPtrListIterator<KAction> linkGroupIt(dolphin.linkGroupActions());
+ //TQPtrListIterator<KAction> linkGroupIt(dolphin.linkGroupActions());
//while ((action = linkGroupIt.current()) != 0) {
// action->plug(createNewMenu);
// ++linkGroupIt;
//}
//
//KPopupMenu* linkToDeviceMenu = new KPopupMenu();
- //QPtrListIterator<KAction> linkToDeviceIt(dolphin.linkToDeviceActions());
+ //TQPtrListIterator<KAction> linkToDeviceIt(dolphin.linkToDeviceActions());
//while ((action = linkToDeviceIt.current()) != 0) {
// action->plug(linkToDeviceMenu);
// ++linkToDeviceIt;
@@ -231,11 +231,11 @@ void DolphinContextMenu::openItemContextMenu()
popup->insertSeparator();
// Insert 'Open With...' sub menu
- QValueVector<KService::Ptr> openWithVector;
+ TQValueVector<KService::Ptr> openWithVector;
const int openWithID = insertOpenWithItems(popup, openWithVector);
// Insert 'Actions' sub menu
- QValueVector<KDEDesktopMimeType::Service> actionsVector;
+ TQValueVector<KDEDesktopMimeType::Service> actionsVector;
insertActionItems(popup, actionsVector);
// insert 'Properties...' entry
@@ -283,7 +283,7 @@ void DolphinContextMenu::openItemContextMenu()
}
int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
- QValueVector<KService::Ptr>& openWithVector)
+ TQValueVector<KService::Ptr>& openWithVector)
{
// Prepare 'Open With' sub menu. Usually a sub menu is created, where all applications
// are listed which are registered to open the item. As last entry "Other..." will be
@@ -293,7 +293,7 @@ int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
assert(list != 0);
bool insertOpenWithItems = true;
- const QString contextMimeType(m_fileInfo->mimetype());
+ const TQString contextMimeType(m_fileInfo->mimetype());
KFileItemListIterator mimeIt(*list);
KFileItem* item = 0;
while (insertOpenWithItems && ((item = mimeIt.current()) != 0)) {
@@ -317,7 +317,7 @@ int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
// application entries. Although this seems to be a configuration
// problem outside the scope of Dolphin, duplicated entries just
// will be skipped here.
- const QString appName((*it)->name());
+ const TQString appName((*it)->name());
if (!containsEntry(openWithMenu, appName)) {
openWithMenu->insertItem((*it)->pixmap(KIcon::Small),
appName, index);
@@ -351,25 +351,25 @@ int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
}
void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
- QValueVector<KDEDesktopMimeType::Service>& actionsVector)
+ TQValueVector<KDEDesktopMimeType::Service>& actionsVector)
{
KPopupMenu* actionsMenu = new KPopupMenu();
int actionsIndex = 0;
- QStringList dirs = KGlobal::dirs()->findDirs("data", "d3lphin/servicemenus/");
+ TQStringList dirs = KGlobal::dirs()->findDirs("data", "d3lphin/servicemenus/");
KPopupMenu* menu = 0;
- for (QStringList::ConstIterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) {
- QDir dir(*dirIt);
- QStringList entries = dir.entryList("*.desktop", QDir::Files);
+ for (TQStringList::ConstIterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) {
+ TQDir dir(*dirIt);
+ TQStringList entries = dir.entryList("*.desktop", TQDir::Files);
- for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
+ for (TQStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
KSimpleConfig cfg(*dirIt + *entryIt, true);
cfg.setDesktopGroup();
if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
- const QStringList types = cfg.readListEntry("ServiceTypes");
- for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
+ const TQStringList types = cfg.readListEntry("ServiceTypes");
+ for (TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
// check whether the mime type is equal or whether the
// mimegroup (e. g. image/*) is supported
@@ -400,12 +400,12 @@ void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
KFileItem* item = 0;
insert = true;
while (insert && ((item = mimeIt.current()) != 0)) {
- const QString mimeType((*mimeIt)->mimetype());
- const QString mimeGroup(mimeType.left(mimeType.find('/')));
+ const TQString mimeType((*mimeIt)->mimetype());
+ const TQString mimeGroup(mimeType.left(mimeType.tqfind('/')));
insert = (*it == mimeType) ||
((*it).right(1) == "*") &&
- ((*it).left((*it).find('/')) == mimeGroup);
+ ((*it).left((*it).tqfind('/')) == mimeGroup);
++mimeIt;
}
}
@@ -413,16 +413,16 @@ void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
if (insert) {
menu = actionsMenu;
- const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
+ const TQString submenuName = cfg.readEntry( "X-KDE-Submenu" );
if (!submenuName.isEmpty()) {
menu = new KPopupMenu();
actionsMenu->insertItem(submenuName, menu, submenuID);
}
- QValueList<KDEDesktopMimeType::Service> userServices =
+ TQValueList<KDEDesktopMimeType::Service> userServices =
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
- QValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
+ TQValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
KDEDesktopMimeType::Service service = (*serviceIt);
if (!service.m_strIcon.isEmpty()) {
@@ -456,8 +456,8 @@ void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
if (menu == actionsMenu) {
// The item is an action, hence show the action in the root menu.
const int id = actionsMenu->idAt(0);
- const QString text(actionsMenu->text(id));
- const QIconSet* iconSet = actionsMenu->iconSet(id);
+ const TQString text(actionsMenu->text(id));
+ const TQIconSet* iconSet = actionsMenu->iconSet(id);
if (iconSet == 0) {
popup->insertItem(text, id);
}
@@ -478,7 +478,7 @@ void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
}
bool DolphinContextMenu::containsEntry(const KPopupMenu* menu,
- const QString& entryName) const
+ const TQString& entryName) const
{
assert(menu != 0);