summaryrefslogtreecommitdiffstats
path: root/src/notecontent.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-04-07 02:21:44 +0200
committerSlávek Banko <[email protected]>2020-04-10 12:47:05 +0200
commitb51e232350d31b65a8cd055693c7869f0a896193 (patch)
treea92cf4251003376d27c8621bc5116dd980faf381 /src/notecontent.cpp
parent360e269df56279904ac6f2913e8f0c3f786aa8fb (diff)
downloadbasket-b51e232350d31b65a8cd055693c7869f0a896193.tar.gz
basket-b51e232350d31b65a8cd055693c7869f0a896193.zip
Added controlled conversions to char* instead of automatic ascii conversions.
Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit ef3976a6cb843f51333ea43172306a9c8f4954ef)
Diffstat (limited to 'src/notecontent.cpp')
-rw-r--r--src/notecontent.cpp10
1 files changed, 5 insertions, 5 deletions
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<TQString>::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?