summaryrefslogtreecommitdiffstats
path: root/src/notecontent.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-04-07 02:21:44 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-04-10 12:18:18 +0200
commitef3976a6cb843f51333ea43172306a9c8f4954ef (patch)
tree032bda2a007070f9b572f78472c52c9a5f6ec538 /src/notecontent.cpp
parentd175607a268b6cc9dfeaeff1d0a38cf72201ad84 (diff)
downloadbasket-ef3976a6cb843f51333ea43172306a9c8f4954ef.tar.gz
basket-ef3976a6cb843f51333ea43172306a9c8f4954ef.zip
Added controlled conversions to char* instead of automatic ascii conversions.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
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?