From 7af884d886e2428d5b28e9cf7d81c97d7e378123 Mon Sep 17 00:00:00 2001 From: samelian Date: Sun, 16 Jan 2011 14:35:51 +0000 Subject: [PATCH] [kdewebdev/quanta] fix deprecation warnings; make compatible with QT_NO_ASCII_CAST flag git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1214823 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/ksavealldialog.cpp | 4 +-- quanta/components/csseditor/tlpeditors.cpp | 2 +- .../debugger/dbgp/quantadebuggerdbgp.cpp | 2 +- .../components/debugger/debuggermanager.cpp | 4 +-- .../debugger/gubed/quantadebuggergubed.cpp | 8 ++--- .../debugger/gubed/quantadebuggergubed.h | 2 +- .../framewizard/visualframeeditor.cpp | 4 +-- quanta/components/tableeditor/tableeditor.h | 2 +- quanta/dialogs/actionconfigdialog.cpp | 4 +-- quanta/dialogs/actionconfigdialog.h | 2 +- quanta/parsers/parser.cpp | 2 +- quanta/parsers/qtag.h | 4 +-- .../parts/kafka/htmldocumentpropertiesui.ui | 2 +- quanta/parts/kafka/kafkacommon.cpp | 4 +-- quanta/parts/preview/whtmlpart.cpp | 2 +- quanta/plugins/quantaplugin.cpp | 6 ++-- quanta/project/project.cpp | 6 ++-- quanta/project/projectnewweb.cpp | 2 +- quanta/project/uploadprofiles.cpp | 2 +- quanta/src/document.cpp | 10 +++--- quanta/src/dtds.cpp | 2 +- quanta/src/kqapp.cpp | 2 +- quanta/src/quanta.cpp | 34 +++++++++---------- quanta/src/quanta.h | 4 +-- quanta/src/quanta_init.cpp | 2 +- quanta/src/quantadoc.cpp | 6 ++-- quanta/treeviews/basetreeview.cpp | 2 +- quanta/treeviews/projecttreeview.cpp | 4 +-- quanta/treeviews/projecttreeview.h | 1 - quanta/treeviews/scripttreeview.cpp | 3 +- quanta/treeviews/tagattributetree.cpp | 6 ++-- quanta/treeviews/templatestreeview.cpp | 8 ++--- quanta/utility/qpevents.cpp | 2 +- quanta/utility/quantacommon.h | 2 +- quanta/utility/tagaction.cpp | 2 +- quanta/utility/tagactionset.cpp | 4 +-- 36 files changed, 77 insertions(+), 81 deletions(-) diff --git a/lib/ksavealldialog.cpp b/lib/ksavealldialog.cpp index 3aecd72f..3b168a4a 100644 --- a/lib/ksavealldialog.cpp +++ b/lib/ksavealldialog.cpp @@ -62,7 +62,7 @@ KSaveSelectDialog::KSaveSelectDialog( KURL::List const & filelist, KURL::List co _listview->header()->hide(); _listview->setResizeMode( TQListView::LastColumn ); - setButtonOKText( i18n("Save &Selected"), i18n("Saves all selected files") ); + setButtonOK( KGuiItem( i18n("Save &Selected"), TQString::null, i18n("Saves all selected files") ) ); setButtonText( User1, i18n("Save &None") ); setButtonText( Close, KStdGuiItem::cancel().text() ); setButtonTip( User1, i18n("Lose all modifications") ); @@ -153,7 +153,7 @@ KSaveAllDialog::KSaveAllDialog( const TQStringList& filenames, TQWidget* parent lb->setMinimumHeight( lb->fontMetrics().height() * 5 ); lb->insertStringList( filenames ); - setButtonOKText( i18n("Save &All"), i18n("Saves all modified files") ); + setButtonOK( KGuiItem( i18n("Save &All"), TQString::null, i18n("Saves all modified files") ) ); setButtonText( User1, i18n("Save &None") ); setButtonText( Close, KStdGuiItem::cancel().text() ); setButtonTip( User1, i18n("Lose all modifications") ); diff --git a/quanta/components/csseditor/tlpeditors.cpp b/quanta/components/csseditor/tlpeditors.cpp index 81e72538..057083e1 100644 --- a/quanta/components/csseditor/tlpeditors.cpp +++ b/quanta/components/csseditor/tlpeditors.cpp @@ -48,7 +48,7 @@ TLPEditor::~TLPEditor(){ } void TLPEditor::setButtonIcon(TQString s){ - TQIconSet iconSet = SmallIconSet(TQString::fromLatin1(s)); + TQIconSet iconSet = SmallIconSet(TQString::fromLatin1(s.ascii())); TQPixmap pixMap = iconSet.pixmap( TQIconSet::Small, TQIconSet::Normal ); m_pb->setIconSet(iconSet); m_pb->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); diff --git a/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp b/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp index d16319a9..481c8d61 100644 --- a/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp +++ b/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp @@ -956,7 +956,7 @@ DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const TQDomNode & variablen } else if (type == "string") { - TQCString value = TQCString(variablenode.firstChild().nodeValue()); + TQCString value = TQCString(variablenode.firstChild().nodeValue().ascii()); value = KCodecs::base64Decode(value); return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::String); } diff --git a/quanta/components/debugger/debuggermanager.cpp b/quanta/components/debugger/debuggermanager.cpp index 4c5aaa58..b62b3e3b 100644 --- a/quanta/components/debugger/debuggermanager.cpp +++ b/quanta/components/debugger/debuggermanager.cpp @@ -341,8 +341,8 @@ void DebuggerManager::enableAction(const TQString& action, bool enable) { // The action may or may not exist, depending on capabilities of the debugger plugin KActionCollection *ac = quantaApp->actionCollection(); - if(ac && ac->action(action)) - ac->action(action)->setEnabled(enable); + if(ac && ac->action(action.ascii())) + ac->action(action.ascii())->setEnabled(enable); } } diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.cpp b/quanta/components/debugger/gubed/quantadebuggergubed.cpp index f909832a..8c2ab1b5 100644 --- a/quanta/components/debugger/gubed/quantadebuggergubed.cpp +++ b/quanta/components/debugger/gubed/quantadebuggergubed.cpp @@ -443,7 +443,7 @@ void QuantaDebuggerGubed::processCommand(const TQString& datas) else if(m_command == "status") { long argcnt = args["args"].toLong(); - TQString msg = i18n(args["message"]); // How will we get these messages throught to the translators? + TQString msg = i18n(args["message"].ascii()); // How will we get these messages throught to the translators? for(int cnt = 1; cnt <= argcnt; cnt++) msg.replace("%" + TQString("%1").arg(cnt) + "%", args[TQString("arg%1").arg(cnt)]); @@ -604,15 +604,15 @@ bool QuantaDebuggerGubed::sendCommand(const TQString& command, StringMap args) TQString buffer = phpSerialize(args); buffer = TQString(command + ":%1;" + buffer).arg(buffer.length()); - m_socket->writeBlock(buffer, buffer.length()); + m_socket->writeBlock(buffer.ascii(), buffer.length()); return true; } // Send a command to gubed -bool QuantaDebuggerGubed::sendCommand(const TQString& command, char * firstarg, ...) +bool QuantaDebuggerGubed::sendCommand(const TQString& command, const char * firstarg, ...) { StringMap ca; - char *next; + const char *next; va_list l_Arg; va_start(l_Arg, firstarg); diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.h b/quanta/components/debugger/gubed/quantadebuggergubed.h index 0f41b804..624a8ae8 100644 --- a/quanta/components/debugger/gubed/quantadebuggergubed.h +++ b/quanta/components/debugger/gubed/quantadebuggergubed.h @@ -116,7 +116,7 @@ class QuantaDebuggerGubed : public DebuggerClient // bool sendCommand(const TQString&, const TQString&); bool sendCommand(const TQString& command, StringMap args); - bool sendCommand(const TQString& command, char * firstarg, ...); + bool sendCommand(const TQString& command, const char * firstarg, ...); void processCommand(const TQString&); void sendWatches(); diff --git a/quanta/components/framewizard/visualframeeditor.cpp b/quanta/components/framewizard/visualframeeditor.cpp index db52da97..ec0d9686 100644 --- a/quanta/components/framewizard/visualframeeditor.cpp +++ b/quanta/components/framewizard/visualframeeditor.cpp @@ -286,7 +286,7 @@ void VisualFrameEditor::removeNode(const TQString &l){ void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* parent){ if(n->hasChildren()) { TQString splitterName("splitter"+TQString::number(++splitterIdNumber,10)); - TQSplitter *splitter = new TQSplitter(parent,splitterName); + TQSplitter *splitter = new TQSplitter(parent,splitterName.ascii()); if(SIZES.contains(splitterName)) splitter->setSizes( SIZES[splitterName] ); switch( n->splitType() ){ case VERTICAL : splitter->setOrientation(TQSplitter::Horizontal);break; @@ -300,7 +300,7 @@ void VisualFrameEditor::drawGUI(treeNode *n, TQWidget* parent){ } } else { - SelectableArea *sa=new SelectableArea(parent,n->label()); + SelectableArea *sa=new SelectableArea(parent,n->label().ascii()); if(parent->isA("TQSplitter")) dynamic_cast(parent)->setResizeMode(sa->view(),TQSplitter::KeepSize ); else if(!m_firstInsertedSA) m_firstInsertedSA = sa; diff --git a/quanta/components/tableeditor/tableeditor.h b/quanta/components/tableeditor/tableeditor.h index 4748414e..3b913811 100644 --- a/quanta/components/tableeditor/tableeditor.h +++ b/quanta/components/tableeditor/tableeditor.h @@ -40,7 +40,7 @@ public: -typedef struct NestedTable{ Node *node; int row; int col; int bLine; int bCol; int eLine; int eCol; TQString nestedData;}; +struct NestedTable { Node *node; int row; int col; int bLine; int bCol; int eLine; int eCol; TQString nestedData;}; class Parser; diff --git a/quanta/dialogs/actionconfigdialog.cpp b/quanta/dialogs/actionconfigdialog.cpp index a66f7499..de63fc3e 100644 --- a/quanta/dialogs/actionconfigdialog.cpp +++ b/quanta/dialogs/actionconfigdialog.cpp @@ -103,7 +103,7 @@ ActionConfigDialog::ActionConfigDialog(const TQDict &toolbarList, { if (node.nodeName() == "Action") { - action = ac->action(node.toElement().attribute("name")); + action = ac->action(node.toElement().attribute("name").ascii()); if (action) { oldActionItem = new KListViewItem(item, oldActionItem, action->text().replace(r,""), action->shortcut().toString(), action->name()); @@ -240,7 +240,7 @@ void ActionConfigDialog::slotEditToolbar() { if (node.nodeName() == "Action") { - action = ac->action(node.toElement().attribute("name")); + action = ac->action(node.toElement().attribute("name").ascii()); if (action) { oldItem = new KListViewItem(item, oldItem, action->text().replace(TQRegExp("\\&(?!\\&)"),""), action->shortcut().toString(), action->name()); diff --git a/quanta/dialogs/actionconfigdialog.h b/quanta/dialogs/actionconfigdialog.h index 6eaa9746..d0bee34e 100644 --- a/quanta/dialogs/actionconfigdialog.h +++ b/quanta/dialogs/actionconfigdialog.h @@ -27,7 +27,7 @@ class KPopupMenu; class KShortcut; class KXMLGUIClient; -typedef struct ToolbarEntry{ +struct ToolbarEntry { KXMLGUIClient *guiClient; TQDomDocument *dom; TQPopupMenu *menu; diff --git a/quanta/parsers/parser.cpp b/quanta/parsers/parser.cpp index 1225aaa3..707d97b0 100644 --- a/quanta/parsers/parser.cpp +++ b/quanta/parsers/parser.cpp @@ -1422,7 +1422,7 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd) encoding = encodingIf->encoding(); if (encoding.isEmpty()) encoding = "utf8"; //final fallback - str.setCodec(TQTextCodec::codecForName(encoding)); + str.setCodec(TQTextCodec::codecForName(encoding.ascii())); content = str.read(); file.close(); if (dtd->specialAreas.count()) diff --git a/quanta/parsers/qtag.h b/quanta/parsers/qtag.h index 89aa1e46..c7839c23 100644 --- a/quanta/parsers/qtag.h +++ b/quanta/parsers/qtag.h @@ -37,7 +37,7 @@ class QTag; class Node; //an attribute of a tag looks like: -typedef struct Attribute{ +struct Attribute { TQString name; TQString type; //"input", "check", "list" TQStringList values; //the possible values it can have @@ -87,7 +87,7 @@ enum DTDFamily{Unknown = 0, Xml, Script}; #define MAX_STRUCTGROUPSCOUNT 10 //an internal representation of a DTD -typedef struct DTDStruct +struct DTDStruct { TQString name; ///< DTD name TQString nickName; ///< DTD nickname diff --git a/quanta/parts/kafka/htmldocumentpropertiesui.ui b/quanta/parts/kafka/htmldocumentpropertiesui.ui index 0834a6bd..6314ca62 100644 --- a/quanta/parts/kafka/htmldocumentpropertiesui.ui +++ b/quanta/parts/kafka/htmldocumentpropertiesui.ui @@ -408,7 +408,7 @@ DualEditableTree -
../../treeviews/tagattributetree.h
+
tagattributetree.h
250 100 diff --git a/quanta/parts/kafka/kafkacommon.cpp b/quanta/parts/kafka/kafkacommon.cpp index 0220646d..5d4c5714 100644 --- a/quanta/parts/kafka/kafkacommon.cpp +++ b/quanta/parts/kafka/kafkacommon.cpp @@ -2340,8 +2340,8 @@ Node* kafkaCommon::extractNode(Node *node, NodeModifsSet *modifs, bool extractCh closingNamespaceName = next->tag->nameSpace; closingNodeName = next->tag->name; closingCaseSensitive = next->tag->dtd()->caseSensitive; - if(QuantaCommon::closesTag(namespaceName, nodeName, caseSensitive, - closingNamespaceName, closingNodeName, closingCaseSensitive)) + if(QuantaCommon::closesTag(namespaceName, nodeName, !caseSensitive.isEmpty(), + closingNamespaceName, closingNodeName, !closingCaseSensitive.isEmpty())) extractNode(next, modifs, false, false); } } diff --git a/quanta/parts/preview/whtmlpart.cpp b/quanta/parts/preview/whtmlpart.cpp index 1b34e123..47c1ca70 100644 --- a/quanta/parts/preview/whtmlpart.cpp +++ b/quanta/parts/preview/whtmlpart.cpp @@ -129,7 +129,7 @@ void WHTMLPart::addToHistory(const TQString &url) if ( !history.isEmpty() ) hpos++; - history.append(url); + history.append(url.ascii()); hpos = history.count()-1; diff --git a/quanta/plugins/quantaplugin.cpp b/quanta/plugins/quantaplugin.cpp index 730e41f2..628f38a7 100644 --- a/quanta/plugins/quantaplugin.cpp +++ b/quanta/plugins/quantaplugin.cpp @@ -73,7 +73,7 @@ void QuantaPlugin::setPluginName(const TQString &a_name) m_name = a_name; if (!m_action) { - m_action = new KToggleAction(i18n(a_name.utf8()), 0, this, TQT_SLOT(toggle()), quantaApp->actionCollection(), a_name); + m_action = new KToggleAction(i18n(a_name.utf8()), 0, this, TQT_SLOT(toggle()), quantaApp->actionCollection(), a_name.ascii()); } m_action->setText(a_name); } @@ -124,8 +124,8 @@ bool QuantaPlugin::load() m_targetWidget = 0L; return false; } - m_part->setName(m_name); // for better debug output - m_part->widget()->setName(m_name); //needed to be able to dock the same plugin twice in separate toolviews + m_part->setName(m_name.ascii()); // for better debug output + m_part->widget()->setName(m_name.ascii()); //needed to be able to dock the same plugin twice in separate toolviews m_part->widget()->setFocusPolicy(TQWidget::ClickFocus); quantaApp->slotNewPart(m_part, false); // register the part in the partmanager return true; diff --git a/quanta/project/project.cpp b/quanta/project/project.cpp index abe47943..fa4af964 100644 --- a/quanta/project/project.cpp +++ b/quanta/project/project.cpp @@ -862,7 +862,7 @@ void Project::slotUpload() if (!d->m_uploadDialog) { - d->m_uploadDialog = new ProjectUpload(KURL(), "", false, false, false, i18n("Upload project items...")); + d->m_uploadDialog = new ProjectUpload(KURL(), "", false, false, false, i18n("Upload project items...").ascii()); connect(d->m_uploadDialog, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& )), this, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& ))); d->m_uploadDialog->show(); } else @@ -877,7 +877,7 @@ void Project::slotUploadURL(const KURL& urlToUpload, const TQString& profileName KURL url = QExtFileInfo::toRelative( urlToUpload, d->baseURL); if (!d->m_uploadDialog) { - d->m_uploadDialog = new ProjectUpload(url, profileName, false, quickUpload, markOnly, i18n("Upload project items...")); + d->m_uploadDialog = new ProjectUpload(url, profileName, false, quickUpload, markOnly, i18n("Upload project items...").ascii()); connect(d->m_uploadDialog, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& )), this, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& ))); d->m_uploadDialog->show(); } else @@ -893,7 +893,7 @@ void Project::slotGetMessages(const TQString& data) void Project::slotRescanPrjDir() { RescanPrj *dlg = new RescanPrj( d->m_projectFiles, d->baseURL, d->excludeRx, - d->m_mainWindow, i18n("New Files in Project's Folder")); + d->m_mainWindow, i18n("New Files in Project's Folder").ascii()); if ( dlg->exec() ) { d->insertFiles(dlg->files()); diff --git a/quanta/project/projectnewweb.cpp b/quanta/project/projectnewweb.cpp index 5959d01e..a087497c 100644 --- a/quanta/project/projectnewweb.cpp +++ b/quanta/project/projectnewweb.cpp @@ -103,7 +103,7 @@ void ProjectNewWeb::slotStart() { if (baseURL.protocol() == "file") { - chdir( baseURL.path(1)); + chdir( baseURL.path(1).ascii() ); proc = new KProcess(); proc ->clearArguments(); diff --git a/quanta/project/uploadprofiles.cpp b/quanta/project/uploadprofiles.cpp index 669971ce..cb54c27f 100644 --- a/quanta/project/uploadprofiles.cpp +++ b/quanta/project/uploadprofiles.cpp @@ -85,7 +85,7 @@ TQWidget * UploadProfiles::createTreeview(const UploadProfile &profile) KURL kurl = url(profile.domElement); if (kurl.isValid() && ! kurl.isEmpty()) { - widget = new ServerTreeView(quantaApp->config(), quantaApp, kurl, "ServerTreeView" + profile.name); + widget = new ServerTreeView(quantaApp->config(), quantaApp, kurl, TQString("ServerTreeView" + profile.name).ascii()); widget->setIcon(SmallIcon("up")); widget->setCaption( i18n("Upload Profile") + ": " + profile.name ); quantaApp->addToolWindow(widget, quantaApp->prevDockPosition(widget, KDockWidget::DockRight), quantaApp->getMainDockWidget()); diff --git a/quanta/src/document.cpp b/quanta/src/document.cpp index c3309a42..f42986ab 100644 --- a/quanta/src/document.cpp +++ b/quanta/src/document.cpp @@ -164,7 +164,7 @@ Document::Document(KTextEditor::Document *doc, m_encoding = encodingIf->encoding(); if (m_encoding.isEmpty()) m_encoding = "utf8"; //final fallback - m_codec = TQTextCodec::codecForName(m_encoding); + m_codec = TQTextCodec::codecForName(m_encoding.ascii()); selectionIf = dynamic_cast(m_doc); selectionIfExt = dynamic_cast(m_doc); @@ -630,7 +630,7 @@ void Document::createTempFile() encoding = encodingIf->encoding(); if (encoding.isEmpty()) encoding = "utf8"; //final fallback - tempFile->textStream()->setCodec(TQTextCodec::codecForName(encoding)); + tempFile->textStream()->setCodec(TQTextCodec::codecForName(encoding.ascii())); * (tempFile->textStream()) << editIf->text(); m_tempFileName = TQFileInfo(*(tempFile->file())).filePath(); @@ -852,7 +852,7 @@ void Document::slotCharactersInserted(int line, int column, const TQString& stri if (encoding != m_encoding) { m_encoding = encoding; - m_codec = TQTextCodec::codecForName(encoding); + m_codec = TQTextCodec::codecForName(encoding.ascii()); } if (!m_codec->canEncode(string[0])) { @@ -2708,7 +2708,7 @@ void Document::createBackup(KConfig* config) if (file.open(IO_WriteOnly)) { TQTextStream stream(&file); - stream.setCodec(TQTextCodec::codecForName(encoding)); + stream.setCodec(TQTextCodec::codecForName(encoding.ascii())); stream << editIf->text(); file.close(); } @@ -2870,7 +2870,7 @@ void Document::open(const KURL &url, const TQString &encoding) { encodingIf->setEncoding(encoding); m_encoding = encoding; - m_codec = TQTextCodec::codecForName(m_encoding); + m_codec = TQTextCodec::codecForName(m_encoding.ascii()); } connect(m_doc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotOpeningCompleted())); connect(m_doc, TQT_SIGNAL(canceled(const TQString&)), this, TQT_SLOT(slotOpeningFailed(const TQString&))); diff --git a/quanta/src/dtds.cpp b/quanta/src/dtds.cpp index 9943904a..cc25516f 100644 --- a/quanta/src/dtds.cpp +++ b/quanta/src/dtds.cpp @@ -784,7 +784,7 @@ void DTDs::setAttributes(TQDomNode *dom, QTag* tag, bool &common) tag->className = el.attribute("class", ""); tag->comment = el.attribute("comment", ""); if (!tag->comment.isEmpty()) - tag->comment = " [" + i18n(tag->comment) + "] "; + tag->comment = " [" + i18n(tag->comment.ascii()) + "] "; tag->comment.prepend(el.attribute("version")); } else { diff --git a/quanta/src/kqapp.cpp b/quanta/src/kqapp.cpp index 1bf2055d..32e1044c 100644 --- a/quanta/src/kqapp.cpp +++ b/quanta/src/kqapp.cpp @@ -41,7 +41,7 @@ QuantaApp *quantaApp = 0L; //global pointer to the main application object #define SPLASH_PICTURE "quantalogo" KSplash::KSplash() - : TQFrame( 0L, TQString("Quanta")+QUANTA_VERSION, + : TQFrame( 0L, "Quanta" QUANTA_VERSION, TQWidget::WStyle_NoBorder | TQWidget::WStyle_Customize | WX11BypassWM) { TQPixmap pm( UserIcon(SPLASH_PICTURE) ); diff --git a/quanta/src/quanta.cpp b/quanta/src/quanta.cpp index 07e2ae26..16795ec9 100644 --- a/quanta/src/quanta.cpp +++ b/quanta/src/quanta.cpp @@ -806,7 +806,7 @@ void QuantaApp::slotRepaintPreview() encoding = encodingIf->encoding(); if (encoding.isEmpty()) encoding = "utf8"; //final fallback - tmpFile->textStream()->setCodec(TQTextCodec::codecForName(encoding)); + tmpFile->textStream()->setCodec(TQTextCodec::codecForName(encoding.ascii())); *(tmpFile->textStream()) << w->editIf->text(); tmpFile->close(); if (!QExtFileInfo::copy(KURL::fromPathOrURL(tempFileName), previewURL, -1, true)) { @@ -1018,7 +1018,7 @@ void QuantaApp::slotOptionsConfigureKeys() { if (node.nodeName() == "Action") { - TagAction *action = dynamic_cast(actionCollection()->action(node.toElement().attribute("name"))); + TagAction *action = dynamic_cast(actionCollection()->action(node.toElement().attribute("name").ascii())); if (action) { action->setModified(true); @@ -1044,7 +1044,7 @@ void QuantaApp::slotConfigureToolbars(const TQString& defaultToolbar) saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); KEditToolbar *dlg; - if (defaultToolbar) + if (!defaultToolbar.isEmpty()) dlg = new KEditToolbar(defaultToolbar, factory(), this); else dlg = new KEditToolbar(factory(), this); @@ -1094,7 +1094,7 @@ void QuantaApp::slotConfigureToolbars(const TQString& defaultToolbar) nodeList = p_toolbar->guiClient->domDocument().elementsByTagName("Action"); for (uint i = 0; i < nodeList.count(); i++) { - KAction *action = ac->action(nodeList.item(i).toElement().attribute("name")); + KAction *action = ac->action(nodeList.item(i).toElement().attribute("name").ascii()); if (action) action->plug(menu); } @@ -1792,8 +1792,8 @@ TQWidget* QuantaApp::createContainer( TQWidget *parent, int index, const TQDomEl //avoid TQToolBar warning in the log QtMsgHandler oldHandler = qInstallMsgHandler( silenceQToolBar ); ToolbarTabWidget *toolbarTab = ToolbarTabWidget::ref(); - TQWidget *w = new TQWidget(toolbarTab, "ToolbarHoldingWidget" + element.attribute("name")); - QuantaToolBar *tb = new QuantaToolBar(w, element.attribute("name"), true, true); + TQWidget *w = new TQWidget(toolbarTab, TQString("ToolbarHoldingWidget" + element.attribute("name")).ascii()); + QuantaToolBar *tb = new QuantaToolBar(w, element.attribute("name").ascii(), true, true); tb->loadState(element); tb->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum); @@ -2234,7 +2234,7 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url) el = node.toElement(); TQString actionName = el.attribute("name"); //if there is no such action yet, add to the available actions - if (!actionCollection()->action(actionName)) + if (!actionCollection()->action(actionName.ascii())) { bool toggable = (el.attribute("toggable", "") == "true"); TagAction *tagAction = new TagAction(&el, this, toggable); @@ -2259,7 +2259,7 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url) } else { // kdDebug(24000) << "The action " << actionName << " is already present!" << endl; - TagAction *tagAction = dynamic_cast(actionCollection()->action(actionName)); + TagAction *tagAction = dynamic_cast(actionCollection()->action(actionName.ascii())); if (tagAction) tagAction->setModified(true); } @@ -2277,7 +2277,7 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url) nodeList = toolbarGUI->domDocument().elementsByTagName("Action"); for (uint i = 0; i < nodeList.count(); i++) { - action = actionCollection()->action(nodeList.item(i).cloneNode().toElement().attribute("name") ); + action = actionCollection()->action(nodeList.item(i).cloneNode().toElement().attribute("name").ascii() ); if (action) { action->plug(menu); @@ -2324,7 +2324,7 @@ void QuantaApp::showToolbarFile(const KURL &url) nodeList = p_toolbar->guiClient->domDocument().elementsByTagName("Action"); for (uint i = 0; i < nodeList.count(); i++) { - action = ac->action(nodeList.item(i).toElement().attribute("name") ); + action = ac->action(nodeList.item(i).toElement().attribute("name").ascii() ); if (action) { action->plug(menu); @@ -2403,7 +2403,7 @@ KURL QuantaApp::saveToolbarToFile(const TQString& toolbarName, const KURL& destF TQDomElement e = n.toElement(); if (e.tagName() == "Action") { - TagAction *action = dynamic_cast(actionCollection()->action(e.attribute("name"))); + TagAction *action = dynamic_cast(actionCollection()->action(e.attribute("name").ascii())); if (action) { action->data().save(actStr,1); @@ -2735,7 +2735,7 @@ void QuantaApp::slotSendToolbar() TQStringList toolbarFile; toolbarFile += tempFileName; - TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send toolbar in email")); + TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send toolbar in email").ascii() ); TQString toStr; TQString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] toolbar.\n\nHave fun.\n"); TQString titleStr; @@ -3285,7 +3285,7 @@ bool QuantaApp::slotRemoveToolbar(const TQString& a_name) nodeList = toolbarGUI->domDocument().elementsByTagName("Action"); for (uint i = 0; i < nodeList.count(); i++) { - action = actionCollection()->action(nodeList.item(i).toElement().attribute("name")); + action = actionCollection()->action(nodeList.item(i).toElement().attribute("name").ascii()); if (dynamic_cast(action) && dynamic_cast(action)->isModified()) { @@ -3377,7 +3377,7 @@ bool QuantaApp::slotRemoveToolbar(const TQString& a_name) nodeList = p_toolbar->dom->elementsByTagName("Action"); for (uint i = 0; i < nodeList.count(); i++) { - action = actionCollection()->action(nodeList.item(i).toElement().attribute("name")); + action = actionCollection()->action(nodeList.item(i).toElement().attribute("name").ascii()); if (action && !action->isPlugged()) { if (dynamic_cast(action) && @@ -3609,7 +3609,7 @@ void QuantaApp::slotEmailDTEP() TQStringList dtdFile; dtdFile += tempFileName; - TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send DTEP in Email")); + TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send DTEP in Email").ascii()); TQString toStr; TQString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] DTEP definition tarball.\n\nHave fun.\n"); TQString titleStr; @@ -4558,7 +4558,7 @@ void QuantaApp::slotTagMail() Document *w = ViewManager::ref()->activeDocument(); if (!w) return; - TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Email Link (mailto)")); + TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Email Link (mailto)").ascii() ); if ( mailDlg->exec() ) { TQString tag = TQString(QuantaCommon::tagCase("activeDocument(); if (!w) return; - TagQuickListDlg *listDlg = new TagQuickListDlg(this,i18n("Generate List")); + TagQuickListDlg *listDlg = new TagQuickListDlg(this,i18n("Generate List").ascii()); if ( listDlg->exec() ) { int i; int n = listDlg->spinBoxRows->value(); diff --git a/quanta/src/quanta.h b/quanta/src/quanta.h index 7bb5bde3..e55c8814 100644 --- a/quanta/src/quanta.h +++ b/quanta/src/quanta.h @@ -19,7 +19,7 @@ #define QUANTA_H #define QUANTA_PACKAGE "quanta" -#define QUANTA_VERSION "3.5.10" +#define QUANTA_VERSION "3.5.13" #define IDS_STATUS 1 #define IDS_INS_OVR 2 @@ -95,8 +95,6 @@ class DebuggerManager; class QuantaInit; class KToolBarPopupAction; class KTempFile; -class KParts::Part; -class KParts::PartManager; namespace KTextEditor { class Mark; diff --git a/quanta/src/quanta_init.cpp b/quanta/src/quanta_init.cpp index 3a752299..e7a5fa75 100644 --- a/quanta/src/quanta_init.cpp +++ b/quanta/src/quanta_init.cpp @@ -983,7 +983,7 @@ void QuantaInit::initActions() TQDomElement e = n.toElement(); // try to convert the node to an element. if( !e.isNull()) { // the node was really an element. - delete ac->action(e.attribute("name")); + delete ac->action(e.attribute("name").ascii()); bool toggable = (e.attribute("toggable", "") == "true"); new TagAction(&e, m_quanta, toggable); } diff --git a/quanta/src/quantadoc.cpp b/quanta/src/quantadoc.cpp index eb5c538f..31fb795b 100644 --- a/quanta/src/quantadoc.cpp +++ b/quanta/src/quantadoc.cpp @@ -268,7 +268,7 @@ void QuantaDoc::slotAttribPopup() TQString name; for (int i=0; i < tag->attrCount(); i++ ) - attrList.append( tag->attribute(i) ); + attrList.append( tag->attribute(i).ascii() ); if ( QuantaCommon::isKnownTag(w->getDTDIdentifier(),tagName) ) { @@ -281,7 +281,7 @@ void QuantaDoc::slotAttribPopup() { name = list->at(i)->name; attribMenu->insertItem( name , i);//list->findIndex(*item) ); - if (attrList.contains(name)) + if (attrList.contains(name.ascii())) { attribMenu->setItemEnabled( i , false ); } @@ -297,7 +297,7 @@ void QuantaDoc::slotAttribPopup() { name = attrs->at(j)->name; popUpMenu->insertItem(name, ++menuId); - if (attrList.contains(name)) + if (attrList.contains(name.ascii())) { popUpMenu->setItemEnabled( menuId , false ); } diff --git a/quanta/treeviews/basetreeview.cpp b/quanta/treeviews/basetreeview.cpp index c7f65b22..952badbe 100644 --- a/quanta/treeviews/basetreeview.cpp +++ b/quanta/treeviews/basetreeview.cpp @@ -437,7 +437,7 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) TQFrame *quantaFilePage = propDlg->addPage(i18n("Quanta File Info")); TQVBoxLayout *topLayout = new TQVBoxLayout( quantaFilePage); - quantaFileProperties = new FileInfoDlg( quantaFilePage, i18n("Quanta") ); + quantaFileProperties = new FileInfoDlg( quantaFilePage, i18n("Quanta").ascii() ); int fsize,fimgsize=0; int ct=0,imgct=0,position=0; diff --git a/quanta/treeviews/projecttreeview.cpp b/quanta/treeviews/projecttreeview.cpp index 0b28e246..205e5bf0 100644 --- a/quanta/treeviews/projecttreeview.cpp +++ b/quanta/treeviews/projecttreeview.cpp @@ -188,7 +188,7 @@ ProjectTreeView::~ProjectTreeView(){ KFileTreeBranch* ProjectTreeView::newBranch(const KURL& url) { TQString m_projectNameStr = m_projectName+" "; - if (m_projectName) + if (!m_projectName.isEmpty()) { if (url.protocol() == "file") { @@ -212,7 +212,7 @@ KFileTreeBranch* ProjectTreeView::newBranch(const KURL& url) this, TQT_SLOT(slotPopulateFinished(KFileTreeViewItem*))); addBranch(m_projectDir); m_projectDir->urlList = m_projectFiles; // set list for filter - if (m_projectName) + if (!m_projectName.isEmpty()) m_projectDir->populate(m_projectDir->rootUrl(), m_projectDir->root()); else m_projectDir->root()->setEnabled(false); diff --git a/quanta/treeviews/projecttreeview.h b/quanta/treeviews/projecttreeview.h index e0235d30..463f660c 100644 --- a/quanta/treeviews/projecttreeview.h +++ b/quanta/treeviews/projecttreeview.h @@ -22,7 +22,6 @@ #include "basetreeview.h" //#include "projecturl.h" -class KIO::Job; class FileInfoDlg; class ProjectList; diff --git a/quanta/treeviews/scripttreeview.cpp b/quanta/treeviews/scripttreeview.cpp index 896ed243..2e7959bf 100644 --- a/quanta/treeviews/scripttreeview.cpp +++ b/quanta/treeviews/scripttreeview.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -270,7 +269,7 @@ void ScriptTreeView::slotSendScriptInMail() TQStringList attachmentFile; attachmentFile += createScriptTarball(); - TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send script in email")); + TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send script in email").ascii() ); TQString toStr; TQString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] script tarball.\n\nHave fun.\n"); TQString titleStr; diff --git a/quanta/treeviews/tagattributetree.cpp b/quanta/treeviews/tagattributetree.cpp index 565c5a4c..9ea6fc40 100644 --- a/quanta/treeviews/tagattributetree.cpp +++ b/quanta/treeviews/tagattributetree.cpp @@ -461,17 +461,17 @@ EnhancedTagAttributeTree::EnhancedTagAttributeTree(TQWidget *parent, const char attrTree->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding); widgetLayout->addMultiCellWidget( attrTree, 1, 1, 0, 3 ); - nodeName = new TQLabel(this, i18n( "Node Name" )); + nodeName = new TQLabel(this, i18n( "Node Name" ).ascii()); nodeName->setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed, 0, 0, nodeName->sizePolicy().hasHeightForWidth() ) ); widgetLayout->addWidget( nodeName, 0, 0 ); - deleteTag = new KPushButton(this, i18n( "Delete Tag" )); + deleteTag = new KPushButton(this, i18n( "Delete Tag" ).ascii()); deleteTag->setPixmap(SmallIcon("editdelete")); deleteTag->setMaximumHeight(32); deleteTag->setMaximumWidth(32); TQToolTip::add(deleteTag, i18n("Delete the current tag only.")); - deleteAll = new KPushButton(this, i18n( "Delete All" )); + deleteAll = new KPushButton(this, i18n( "Delete All" ).ascii()); deleteAll->setPixmap(SmallIcon("editdelete")); deleteAll->setMaximumHeight(32); deleteAll->setMaximumWidth(32); diff --git a/quanta/treeviews/templatestreeview.cpp b/quanta/treeviews/templatestreeview.cpp index 0b9973e8..f1eaca73 100644 --- a/quanta/treeviews/templatestreeview.cpp +++ b/quanta/treeviews/templatestreeview.cpp @@ -259,7 +259,7 @@ void TemplatesTreeView::slotMenu(KListView*, TQListViewItem *item, const TQPoint return; } setSelected(item, true); - bool hasProject = m_projectName; + bool hasProject = !m_projectName.isEmpty(); m_folderMenu->setItemVisible(m_insertFolderInProject, hasProject); m_fileMenu->setItemVisible(m_insertFileInProject, hasProject); @@ -373,7 +373,7 @@ void TemplatesTreeView::slotOpen() /** No descriptions */ void TemplatesTreeView::slotNewDir() { - NewTemplateDirDlg *createDirDlg = new NewTemplateDirDlg(this,i18n("Create New Template Folder")); + NewTemplateDirDlg *createDirDlg = new NewTemplateDirDlg(this,i18n("Create New Template Folder").ascii()); createDirDlg->typesCombo->insertItem(typeToi18n["text/all"]); createDirDlg->typesCombo->insertItem(typeToi18n["file/all"]); createDirDlg->typesCombo->insertItem(typeToi18n["template/all"]); @@ -564,7 +564,7 @@ void TemplatesTreeView::slotProperties() //Always add the Quanta directory page TQFrame *quantaDirPage = propDlg->addPage(i18n("Quanta Template")); TQVBoxLayout *topLayout = new TQVBoxLayout( quantaDirPage); - m_quantaProperties = new QuantaPropertiesPage( quantaDirPage, i18n("Quanta") ); + m_quantaProperties = new QuantaPropertiesPage( quantaDirPage, i18n("Quanta").ascii() ); m_quantaProperties->typesCombo->insertItem(typeToi18n["text/all"]); m_quantaProperties->typesCombo->insertItem(typeToi18n["file/all"]); @@ -982,7 +982,7 @@ void TemplatesTreeView::slotSendInMail() TQStringList attachmentFile; attachmentFile += createTemplateTarball(); - TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send template in email")); + TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send template in email").ascii() ); TQString toStr; TQString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] template tarball.\n\nHave fun.\n"); TQString titleStr; diff --git a/quanta/utility/qpevents.cpp b/quanta/utility/qpevents.cpp index 7bad8715..3426b83f 100644 --- a/quanta/utility/qpevents.cpp +++ b/quanta/utility/qpevents.cpp @@ -321,7 +321,7 @@ bool QPEvents::handleEvent(const EventAction& ev) if (ev.action == "script" || ev.action =="action") { TQString name = ev.arguments[0]; - KAction *action = quantaApp->actionCollection()->action(name); + KAction *action = quantaApp->actionCollection()->action(name.ascii()); TagAction *tagAction = dynamic_cast(action); if (tagAction) { diff --git a/quanta/utility/quantacommon.h b/quanta/utility/quantacommon.h index ac209570..915de6fb 100644 --- a/quanta/utility/quantacommon.h +++ b/quanta/utility/quantacommon.h @@ -104,7 +104,7 @@ public: bool smartTagInsertion; //enable/disable smartTagInsertion }; -typedef struct DirInfo{ +struct DirInfo { TQString mimeType; TQString preText; TQString postText; diff --git a/quanta/utility/tagaction.cpp b/quanta/utility/tagaction.cpp index 28d37450..9787d047 100644 --- a/quanta/utility/tagaction.cpp +++ b/quanta/utility/tagaction.cpp @@ -74,7 +74,7 @@ int MyProcess::commSetupDoneC() TagAction::TagAction( TQDomElement *element, KMainWindow *parentMainWindow, bool toggle) : KToggleAction(element->attribute("text").isEmpty() ? TQString("") : i18n(element->attribute("text").utf8()), - KShortcut(element->attribute("shortcut")), 0, 0, parentMainWindow->actionCollection(), element->attribute("name")), + KShortcut(element->attribute("shortcut")), 0, 0, parentMainWindow->actionCollection(), element->attribute("name").ascii()), //disable toggle now m_toggle(toggle) m_toggle(false) { diff --git a/quanta/utility/tagactionset.cpp b/quanta/utility/tagactionset.cpp index a74df537..28f01ef8 100644 --- a/quanta/utility/tagactionset.cpp +++ b/quanta/utility/tagactionset.cpp @@ -100,7 +100,7 @@ void TagActionSet::initActions(TQWidget* /*parent*/) { KActionCollection* ac(TagActionManager::self()->actionCollection()); - TQString actionName = "apply_source_indentation"; + const char *actionName = "apply_source_indentation"; new KAction(i18n("Apply Source Indentation"), 0, this, TQT_SLOT(slotApplySourceIndentation()), ac, actionName); @@ -296,7 +296,7 @@ void TableTagActionSet::initActions(TQWidget* parent) // Insert___________________________________________________________________________ - TQString actionName = "insert_table"; + const char *actionName = "insert_table"; //m_actionNames += actionName; new KAction(i18n("Table..."), 0, this, TQT_SLOT(slotInsertTable()),