diff options
Diffstat (limited to 'kexi/plugins/macros/kexiactions/openaction.cpp')
-rw-r--r-- | kexi/plugins/macros/kexiactions/openaction.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kexi/plugins/macros/kexiactions/openaction.cpp b/kexi/plugins/macros/kexiactions/openaction.cpp index b67041bb..2e43116f 100644 --- a/kexi/plugins/macros/kexiactions/openaction.cpp +++ b/kexi/plugins/macros/kexiactions/openaction.cpp @@ -33,13 +33,13 @@ using namespace KexiMacro; namespace KexiMacro { - static const QString DATAVIEW = "data"; - static const QString DESIGNVIEW = "design"; - static const QString TEXTVIEW = "text"; + static const TQString DATAVIEW = "data"; + static const TQString DESIGNVIEW = "design"; + static const TQString TEXTVIEW = "text"; - static const QString OBJECT = "object"; - static const QString NAME = "name"; - static const QString VIEW = "view"; + static const TQString OBJECT = "object"; + static const TQString NAME = "name"; + static const TQString VIEW = "view"; /** * The ViewVariable class provide a list of viewmodes supported @@ -49,11 +49,11 @@ namespace KexiMacro { class ViewVariable : public KexiVariable<ACTIONIMPL> { public: - ViewVariable(ACTIONIMPL* actionimpl, const QString& objectname = QString::null, const QString& viewname = QString::null) + ViewVariable(ACTIONIMPL* actionimpl, const TQString& objectname = TQString(), const TQString& viewname = TQString()) : KexiVariable<ACTIONIMPL>(actionimpl, VIEW, i18n("View")) { - QStringList namelist; - KexiPart::Part* part = Kexi::partManager().partForMimeType( QString("kexi/%1").arg(objectname) ); + TQStringList namelist; + KexiPart::Part* part = Kexi::partManager().partForMimeType( TQString("kexi/%1").tqarg(objectname) ); if(part) { int viewmodes = part->supportedViewModes(); if(viewmodes & Kexi::DataViewMode) @@ -62,11 +62,11 @@ namespace KexiMacro { namelist << DESIGNVIEW; if(viewmodes & Kexi::TextViewMode) namelist << TEXTVIEW; - for(QStringList::Iterator it = namelist.begin(); it != namelist.end(); ++it) - this->children().append( KSharedPtr<KoMacro::Variable>(new KoMacro::Variable(*it)) ); + for(TQStringList::Iterator it = namelist.begin(); it != namelist.end(); ++it) + this->tqchildren().append( KSharedPtr<KoMacro::Variable>(new KoMacro::Variable(*it)) ); } - const QString n = - namelist.contains(viewname) + const TQString n = + namelist.tqcontains(viewname) ? viewname : namelist.count() > 0 ? namelist[0] : ""; @@ -92,7 +92,7 @@ OpenAction::~OpenAction() { } -bool OpenAction::notifyUpdated(KSharedPtr<KoMacro::MacroItem> macroitem, const QString& name) +bool OpenAction::notifyUpdated(KSharedPtr<KoMacro::MacroItem> macroitem, const TQString& name) { kdDebug()<<"OpenAction::notifyUpdated() name="<<name<<" macroitem.action="<<(macroitem->action() ? macroitem->action()->name() : "NOACTION")<<endl; KSharedPtr<KoMacro::Variable> variable = macroitem->variable(name, false); @@ -103,9 +103,9 @@ bool OpenAction::notifyUpdated(KSharedPtr<KoMacro::MacroItem> macroitem, const Q variable->clearChildren(); if(name == OBJECT) { - const QString objectvalue = macroitem->variant(OBJECT, true).toString(); // e.g. "table" or "query" - const QString objectname = macroitem->variant(NAME, true).toString(); // e.g. "table1" or "table2" if objectvalue above is "table" - const QString viewname = macroitem->variant(VIEW, true).toString(); // "data", "design" or "text" + const TQString objectvalue = macroitem->variant(OBJECT, true).toString(); // e.g. "table" or "query" + const TQString objectname = macroitem->variant(NAME, true).toString(); // e.g. "table1" or "table2" if objectvalue above is "table" + const TQString viewname = macroitem->variant(VIEW, true).toString(); // "data", "design" or "text" macroitem->variable(NAME, true)->setChildren( KoMacro::Variable::List() << KSharedPtr<KoMacro::Variable>(new ObjectNameVariable<OpenAction>(this, objectvalue, objectname)) ); @@ -122,15 +122,15 @@ void OpenAction::activate(KSharedPtr<KoMacro::Context> context) throw KoMacro::Exception(i18n("No project loaded.")); } - const QString objectname = context->variable(OBJECT)->variant().toString(); - const QString name = context->variable(NAME)->variant().toString(); - KexiPart::Item* item = mainWin()->project()->itemForMimeType( QString("kexi/%1").arg(objectname).latin1(), name ); + const TQString objectname = context->variable(OBJECT)->variant().toString(); + const TQString name = context->variable(NAME)->variant().toString(); + KexiPart::Item* item = mainWin()->project()->itemForMimeType( TQString("kexi/%1").tqarg(objectname).latin1(), name ); if(! item) { - throw KoMacro::Exception(i18n("No such object \"%1.%2\".").arg(objectname).arg(name)); + throw KoMacro::Exception(i18n("No such object \"%1.%2\".").tqarg(objectname).tqarg(name)); } // Determinate the viewmode. - const QString view = context->variable(VIEW)->variant().toString(); + const TQString view = context->variable(VIEW)->variant().toString(); int viewmode; if(view == DATAVIEW) viewmode = Kexi::DataViewMode; @@ -139,14 +139,14 @@ void OpenAction::activate(KSharedPtr<KoMacro::Context> context) else if(view == TEXTVIEW) viewmode = Kexi::TextViewMode; else { - throw KoMacro::Exception(i18n("No such viewmode \"%1\" in object \"%2.%3\".").arg(view).arg(objectname).arg(name)); + throw KoMacro::Exception(i18n("No such viewmode \"%1\" in object \"%2.%3\".").tqarg(view).tqarg(objectname).tqarg(name)); } // Try to open the object now. bool openingCancelled; if(! mainWin()->openObject(item, viewmode, openingCancelled)) { if(! openingCancelled) { - throw KoMacro::Exception(i18n("Failed to open object \"%1.%2\".").arg(objectname).arg(name)); + throw KoMacro::Exception(i18n("Failed to open object \"%1.%2\".").tqarg(objectname).tqarg(name)); } } } |