diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-12-04 09:03:25 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2017-07-22 15:56:41 +0200 |
commit | fc073bef59b83a10ca17c82fe19771f5edee321d (patch) | |
tree | 67aab4e0d5a4e2d9db3e43bc3fb272b500267b4f /kio | |
parent | d16c4300eb9a917ff477f96e6f81c7887c88b0e0 (diff) | |
download | tdelibs-fc073bef59b83a10ca17c82fe19771f5edee321d.tar.gz tdelibs-fc073bef59b83a10ca17c82fe19771f5edee321d.zip |
Fix a number of build warnings
(cherry picked from commit e0b1bfb0140e1d484f71683e820731abdd0779d5)
Diffstat (limited to 'kio')
-rw-r--r-- | kio/bookmarks/kbookmark.cc | 15 | ||||
-rw-r--r-- | kio/bookmarks/kbookmarkmanager.cc | 6 | ||||
-rw-r--r-- | kio/kio/forwardingslavebase.cpp | 2 | ||||
-rw-r--r-- | kio/kio/job.cpp | 4 | ||||
-rw-r--r-- | kio/kio/kzip.cpp | 4 | ||||
-rw-r--r-- | kio/kio/slavebase.cpp | 14 | ||||
-rw-r--r-- | kio/kio/slaveinterface.cpp | 10 |
7 files changed, 36 insertions, 19 deletions
diff --git a/kio/bookmarks/kbookmark.cc b/kio/bookmarks/kbookmark.cc index 44b8b496c..74657f16f 100644 --- a/kio/bookmarks/kbookmark.cc +++ b/kio/bookmarks/kbookmark.cc @@ -296,16 +296,21 @@ KURL KBookmark::url() const TQString KBookmark::icon() const { TQString icon = element.attribute("icon"); - if ( icon.isEmpty() ) + if ( icon.isEmpty() ) { // Default icon depends on URL for bookmarks, and is default directory // icon for groups. - if ( isGroup() ) + if ( isGroup() ) { icon = "bookmark_folder"; - else - if ( isSeparator() ) + } + else { + if ( isSeparator() ) { icon = "eraser"; // whatever - else + } + else { icon = KMimeType::iconForURL( url() ); + } + } + } return icon; } diff --git a/kio/bookmarks/kbookmarkmanager.cc b/kio/bookmarks/kbookmarkmanager.cc index 96ce12896..b80120fd4 100644 --- a/kio/bookmarks/kbookmarkmanager.cc +++ b/kio/bookmarks/kbookmarkmanager.cc @@ -255,6 +255,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group ) { TQDomElement e = n.toElement(); if ( !e.isNull() ) + { if ( e.tagName() == "TEXT" ) { e.setTagName("title"); @@ -280,6 +281,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group ) convertToXBEL( e ); } else + { if ( e.tagName() == "BOOKMARK" ) { e.setTagName("bookmark"); // so much difference :-) @@ -294,7 +296,11 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group ) titleElem.appendChild( e.ownerDocument().createTextNode( text ) ); } else + { kdWarning(7043) << "Unknown tag " << e.tagName() << endl; + } + } + } n = n.nextSibling(); } } diff --git a/kio/kio/forwardingslavebase.cpp b/kio/kio/forwardingslavebase.cpp index c83d5750c..ec366a86d 100644 --- a/kio/kio/forwardingslavebase.cpp +++ b/kio/kio/forwardingslavebase.cpp @@ -69,7 +69,6 @@ void ForwardingSlaveBase::prepareUDSEntry(KIO::UDSEntry &entry, kdDebug() << "ForwardingSlaveBase::prepareUDSEntry: listing==" << listing << endl; - bool url_found = false; TQString name; KURL url; @@ -87,7 +86,6 @@ void ForwardingSlaveBase::prepareUDSEntry(KIO::UDSEntry &entry, kdDebug() << "Name = " << name << endl; break; case KIO::UDS_URL: - url_found = true; url = (*it).m_str; if (listing) { diff --git a/kio/kio/job.cpp b/kio/kio/job.cpp index 58bb00c58..7bb9a1919 100644 --- a/kio/kio/job.cpp +++ b/kio/kio/job.cpp @@ -4273,7 +4273,7 @@ void DeleteJob::slotResult( Job *job ) UDSEntry entry = ((StatJob*)job)->statResult(); bool bDir = false; bool bLink = false; - KIO::filesize_t size = (KIO::filesize_t)-1; +// KIO::filesize_t size = (KIO::filesize_t)-1; UDSEntry::ConstIterator it2 = entry.begin(); int atomsFound(0); for( ; it2 != entry.end(); it2++ ) @@ -4290,7 +4290,7 @@ void DeleteJob::slotResult( Job *job ) } else if ( ((*it2).m_uds) == UDS_SIZE ) { - size = (*it2).m_long; +// size = (*it2).m_long; atomsFound++; } if (atomsFound==3) break; diff --git a/kio/kio/kzip.cpp b/kio/kio/kzip.cpp index 4a3a46ab5..7a7f443e6 100644 --- a/kio/kio/kzip.cpp +++ b/kio/kio/kzip.cpp @@ -627,9 +627,9 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; else { // kdDebug(7040) << "before interesting dev->at(): " << dev->at() << endl; - bool success; +/* bool success; success = dev->at( dev->at() + compr_size ); // can this fail ??? -/* kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl; + kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl; if ( success ) kdDebug(7040) << "dev->at was successful... " << endl; else diff --git a/kio/kio/slavebase.cpp b/kio/kio/slavebase.cpp index b61fcbb1b..57ade2ea7 100644 --- a/kio/kio/slavebase.cpp +++ b/kio/kio/slavebase.cpp @@ -734,21 +734,25 @@ void SlaveBase::sigsegv_handler(int sig) // call malloc.. and get in a nice recursive malloc loop char buffer[120]; snprintf(buffer, sizeof(buffer), "kioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig); - write(2, buffer, strlen(buffer)); + if (write(2, buffer, strlen(buffer)) >= 0) { #ifdef SECURE_DEBUG kdBacktraceFD(); #else // SECURE_DEBUG - // Screw the malloc issue! We want nice demangled backtrace! + // Screw the malloc issue! We want nice demangled backtraces! // Anyway we are not supposed to go into infinite loop because next signal - // will kill us. If you are unlucky and there is a second crash during - // backtrase in your system, you can define SECURE_DEBUG to avoid it + // will kill us. If you are unlucky and there is a second crash during + // backtrase in your system, you can define SECURE_DEBUG to avoid it // Extra sync here so we are sure even if the backtrace will fail // we will pass at least some crash message. fsync(2); TQString backtrace = kdBacktrace(); - write(2, backtrace.ascii(), backtrace.length()); + if (write(2, backtrace.ascii(), backtrace.length()) < 0) { + // FIXME + // Could not write crash information + } #endif // SECURE_DEBUG + } ::exit(1); #endif } diff --git a/kio/kio/slaveinterface.cpp b/kio/kio/slaveinterface.cpp index 62c64d566..e60929040 100644 --- a/kio/kio/slaveinterface.cpp +++ b/kio/kio/slaveinterface.cpp @@ -526,11 +526,15 @@ void SlaveInterface::sigpipe_handler(int) { int saved_errno = errno; // Using kdDebug from a signal handler is not a good idea. -#ifndef NDEBUG +#ifndef NDEBUG char msg[1000]; sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid()); - write(2, msg, strlen(msg)); -#endif + if (write(2, msg, strlen(msg)) < 0) { + // FIXME + // Could not write error message + // Triple fault? ;-) + } +#endif // Do nothing. // dispatch will return false and that will trigger ERR_SLAVE_DIED in slave.cpp |