diff --git a/src/archive.cpp b/src/archive.cpp index 702dde9..3f3377c 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -224,7 +224,7 @@ void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, TQS } progress->advance(1); // Basket exportation finished - std::cout << basket->basketName() << " finished" << std::endl; + std::cout << basket->basketName().local8Bit() << " finished" << std::endl; // Recursively save child baskets: BasketListViewItem *item = Global::bnpView->listViewItemForBasket(basket); diff --git a/src/basket.cpp b/src/basket.cpp index 5355ff7..6e14c65 100644 --- a/src/basket.cpp +++ b/src/basket.cpp @@ -346,7 +346,7 @@ void debugZone(int zone) s = "Emblem0+" + TQString::number(zone - Note::Emblem0); break; } - std::cout << s << std::endl; + std::cout << s.local8Bit() << std::endl; } #define FOR_EACH_NOTE(noteVar) \ @@ -1357,7 +1357,7 @@ Basket::Basket(TQWidget *parent, const TQString &folderName) m_finishLoadOnFirstShow(false), m_relayoutOnNextShow(false) { TQString sAction = "local_basket_activate_" + folderName; - m_action = new TDEAction("FAKE TEXT", "FAKE ICON", TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT(activatedShortcut()), Global::bnpView->actionCollection(), sAction); + m_action = new TDEAction("FAKE TEXT", "FAKE ICON", TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT(activatedShortcut()), Global::bnpView->actionCollection(), sAction.utf8()); m_action->setShortcutConfigurable(false); // We do it in the basket properties dialog (and keep it in sync with the global one) if (!m_folderName.endsWith("/")) @@ -3954,7 +3954,7 @@ void debugSel(NoteSelection* sel, int n = 0) for (NoteSelection *node = sel; node; node = node->next) { for (int i = 0; i < n; i++) std::cout << "-"; - std::cout << (node->firstChild ? "Group" : node->note->content()->toText("")) << std::endl; + std::cout << (node->firstChild ? "Group" : node->note->content()->toText("").local8Bit()) << std::endl; if (node->firstChild) debugSel(node->firstChild, n+1); } diff --git a/src/focusedwidgets.cpp b/src/focusedwidgets.cpp index 9020f69..2ab28c7 100644 --- a/src/focusedwidgets.cpp +++ b/src/focusedwidgets.cpp @@ -117,7 +117,7 @@ void FocusedTextEdit::adaptClipboardText(TQClipboard::Mode mode) if ( (textFormat() == TQt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) { TQString text = clipboard->text(mode); - if (text) { + if (!text.isEmpty()) { text = text.replace("\n", TQChar(0x2028)); clipboard->setText(text, mode); } diff --git a/src/htmlexporter.cpp b/src/htmlexporter.cpp index ad9a555..c9fe762 100644 --- a/src/htmlexporter.cpp +++ b/src/htmlexporter.cpp @@ -157,18 +157,18 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket) imagesFolderName = (isSubBasket ? "../" : filesFolderName) + i18n("HTML export folder (images)", "images") + "/"; // eg.: "foo.html_files/images/" or "../images/" std::cout << "Exporting ================================================" << std::endl; - std::cout << " filePath:" << filePath << std::endl; - std::cout << " basketFilePath:" << basketFilePath << std::endl; - std::cout << " filesFolderPath:" << filesFolderPath << std::endl; - std::cout << " filesFolderName:" << filesFolderName << std::endl; - std::cout << " iconsFolderPath:" << iconsFolderPath << std::endl; - std::cout << " iconsFolderName:" << iconsFolderName << std::endl; - std::cout << " imagesFolderPath:" << imagesFolderPath << std::endl; - std::cout << " imagesFolderName:" << imagesFolderName << std::endl; - std::cout << " dataFolderPath:" << dataFolderPath << std::endl; - std::cout << " dataFolderName:" << dataFolderName << std::endl; - std::cout << " basketsFolderPath:" << basketsFolderPath << std::endl; - std::cout << " basketsFolderName:" << basketsFolderName << std::endl; + std::cout << " filePath:" << filePath.local8Bit() << std::endl; + std::cout << " basketFilePath:" << basketFilePath.local8Bit() << std::endl; + std::cout << " filesFolderPath:" << filesFolderPath.local8Bit() << std::endl; + std::cout << " filesFolderName:" << filesFolderName.local8Bit() << std::endl; + std::cout << " iconsFolderPath:" << iconsFolderPath.local8Bit() << std::endl; + std::cout << " iconsFolderName:" << iconsFolderName.local8Bit() << std::endl; + std::cout << " imagesFolderPath:" << imagesFolderPath.local8Bit() << std::endl; + std::cout << " imagesFolderName:" << imagesFolderName.local8Bit() << std::endl; + std::cout << " dataFolderPath:" << dataFolderPath.local8Bit() << std::endl; + std::cout << " dataFolderName:" << dataFolderName.local8Bit() << std::endl; + std::cout << " basketsFolderPath:" << basketsFolderPath.local8Bit() << std::endl; + std::cout << " basketsFolderName:" << basketsFolderName.local8Bit() << std::endl; // Create the data folder for this basket: TQDir dir; diff --git a/src/kgpgme.cpp b/src/kgpgme.cpp index 2fddec0..1dffc4b 100644 --- a/src/kgpgme.cpp +++ b/src/kgpgme.cpp @@ -382,12 +382,12 @@ void KGpgMe::setPassphraseCb() if (agent_info.find(':')) agent = true; if(agent_info.startsWith("disable:")) - setenv("GPG_AGENT_INFO", agent_info.mid(8), 1); + setenv("GPG_AGENT_INFO", agent_info.mid(8).local8Bit(), 1); } else { if(!agent_info.startsWith("disable:")) - setenv("GPG_AGENT_INFO", "disable:" + agent_info, 1); + setenv("GPG_AGENT_INFO", "disable:" + agent_info.local8Bit(), 1); } if (agent) gpgme_set_passphrase_cb(m_ctx, 0, 0); diff --git a/src/likeback.cpp b/src/likeback.cpp index 8f3772a..e1ba649 100644 --- a/src/likeback.cpp +++ b/src/likeback.cpp @@ -137,9 +137,9 @@ void LikeBackBar::autoMove() if (window != lastWindow && m_likeBack->windowNamesListing() != LikeBack::NoListing) { if (tqstricmp(window->name(), "") == 0 || tqstricmp(window->name(), "unnamed") == 0) { - std::cout << "===== LikeBack ===== UNNAMED ACTIVE WINDOW OF TYPE " << window->className() << " ======" << LikeBack::activeWindowPath() << std::endl; + std::cout << "===== LikeBack ===== UNNAMED ACTIVE WINDOW OF TYPE " << window->className() << " ======" << LikeBack::activeWindowPath().local8Bit() << std::endl; } else if (m_likeBack->windowNamesListing() == LikeBack::AllWindows) { - std::cout << "LikeBack: Active Window: " << LikeBack::activeWindowPath() << std::endl; + std::cout << "LikeBack: Active Window: " << LikeBack::activeWindowPath().local8Bit() << std::endl; } } lastWindow = window; @@ -818,8 +818,8 @@ void LikeBackDialog::send() "email=" + KURL::encode_string(emailAddress); TQHttp *http = new TQHttp(m_likeBack->hostName(), m_likeBack->hostPort()); - std::cout << "http://" << m_likeBack->hostName() << ":" << m_likeBack->hostPort() << m_likeBack->remotePath() << std::endl; - std::cout << data << std::endl; + std::cout << "http://" << m_likeBack->hostName().local8Bit() << ":" << m_likeBack->hostPort() << m_likeBack->remotePath().local8Bit() << std::endl; + std::cout << data.local8Bit() << std::endl; connect( http, TQT_SIGNAL(requestFinished(int, bool)), this, TQT_SLOT(requestFinished(int, bool)) ); TQHttpRequestHeader header("POST", m_likeBack->remotePath()); diff --git a/src/note.cpp b/src/note.cpp index 6486de3..09eb274 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -2582,7 +2582,7 @@ void Note::debug() else if (isGroup()) std::cout << ": Group"; else - std::cout << ": Content[" << content()->lowerTypeName() << "]: " << toText(""); + std::cout << ": Content[" << content()->lowerTypeName().local8Bit() << "]: " << toText("").local8Bit(); std::cout << std::endl; } diff --git a/src/notecontent.cpp b/src/notecontent.cpp index 3574d7c..00b5795 100644 --- a/src/notecontent.cpp +++ b/src/notecontent.cpp @@ -541,7 +541,7 @@ bool TextContent::loadFromFile(bool lazyLoad) if (success) setText(content, lazyLoad); else { - std::cout << "FAILED TO LOAD TextContent: " << fullPath() << std::endl; + std::cout << "FAILED TO LOAD TextContent: " << fullPath().local8Bit() << std::endl; setText("", lazyLoad); if (!TQFile::exists(fullPath())) saveToFile(); // Reserve the fileName so no new note will have the same name! @@ -650,7 +650,7 @@ bool HtmlContent::loadFromFile(bool lazyLoad) if (success) setHtml(content, lazyLoad); else { - std::cout << "FAILED TO LOAD HtmlContent: " << fullPath() << std::endl; + std::cout << "FAILED TO LOAD HtmlContent: " << fullPath().local8Bit() << std::endl; setHtml("", lazyLoad); if (!TQFile::exists(fullPath())) saveToFile(); // Reserve the fileName so no new note will have the same name! @@ -782,7 +782,7 @@ bool ImageContent::finishLazyLoad() } } - std::cout << "FAILED TO LOAD ImageContent: " << fullPath() << std::endl; + std::cout << "FAILED TO LOAD ImageContent: " << fullPath().local8Bit() << std::endl; m_format = (char*)"PNG"; // If the image is set later, it should be saved without destruction, so we use PNG by default. m_pixmap.resize(1, 1); // Create a 1x1 pixels image instead of an undefined one. m_pixmap.fill(); @@ -1891,14 +1891,14 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject) TQ_UINT64 size; // TODO: It was TQ_UINT32 in version 0.5.0 ! TQByteArray *array; TQStoredDrag *storedDrag; - for (uint i = 0; i < mimes.count(); ++i) { + for (TQValueList::iterator it = mimes.begin(); it != mimes.end(); ++it) { // Get the size: stream >> size; // Allocate memory to retreive size bytes and store them: array = new TQByteArray(size); stream.readRawBytes(array->data(), size); // Creata and add the TQDragObject: - storedDrag = new TQStoredDrag(*(mimes.at(i))); + storedDrag = new TQStoredDrag((*it).utf8()); storedDrag->setEncodedData(*array); dragObject->addDragObject(storedDrag); delete array; // FIXME: Should we? diff --git a/src/tag.cpp b/src/tag.cpp index 429b5fa..b128bb7 100644 --- a/src/tag.cpp +++ b/src/tag.cpp @@ -227,7 +227,7 @@ Tag::Tag() static int tagNumber = 0; ++tagNumber; TQString sAction = "tag_shortcut_number_" + TQString::number(tagNumber); - m_action = new TDEAction("FAKE TEXT", "FAKE ICON", TDEShortcut(), TQT_TQOBJECT(Global::bnpView), TQT_SLOT(activatedTagShortcut()), Global::bnpView->actionCollection(), sAction); + m_action = new TDEAction("FAKE TEXT", "FAKE ICON", TDEShortcut(), TQT_TQOBJECT(Global::bnpView), TQT_SLOT(activatedTagShortcut()), Global::bnpView->actionCollection(), sAction.utf8()); m_action->setShortcutConfigurable(false); // We do it in the tag properties dialog m_inheritedBySiblings = false;