mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-25 03:12:49 +00:00
Merge branch 'master' of https://github.com/fluxer/kdelibs into devinfo
This commit is contained in:
commit
c5c09f07de
6 changed files with 13 additions and 24 deletions
|
@ -702,11 +702,6 @@ QDebug kDebugStream(QtMsgType level, int area, const char *file, int line, const
|
|||
return kDebug_data->stream(level, area, file, line, funcinfo);
|
||||
}
|
||||
|
||||
QDebug perror(QDebug s, KDebugTag)
|
||||
{
|
||||
return s << QString::fromLocal8Bit(strerror(errno));
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug s, const KDateTime &time)
|
||||
{
|
||||
if ( time.isDateOnly() )
|
||||
|
|
|
@ -174,20 +174,6 @@ static inline QDebug kFatal(int area = KDE_DEFAULT_DEBUG_AREA)
|
|||
static inline QDebug kFatal(bool cond, int area = KDE_DEFAULT_DEBUG_AREA)
|
||||
{ return cond ? kFatal(area) : kDebugDevNull(); }
|
||||
|
||||
struct KDebugTag { }; ///! @internal just a tag class
|
||||
typedef QDebug (*KDebugStreamFunction)(QDebug, KDebugTag); ///< @internal
|
||||
inline QDebug operator<<(QDebug s, KDebugStreamFunction f)
|
||||
{ return (*f)(s, KDebugTag()); }
|
||||
|
||||
/**
|
||||
* \relates KGlobal
|
||||
* Print a message describing the last system error.
|
||||
* @param s the debug stream to write to
|
||||
* @return the debug stream (@p s)
|
||||
* @see perror(3)
|
||||
*/
|
||||
KDECORE_EXPORT QDebug perror(QDebug, KDebugTag);
|
||||
|
||||
// operators for KDE types
|
||||
class KUrl;
|
||||
class KDateTime;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
|
@ -595,7 +596,7 @@ static void lookupDirectory(const QString& path, const QString &relPart,
|
|||
{
|
||||
KDE_struct_stat buff;
|
||||
if ( KDE::stat( pathfn, &buff ) != 0 ) {
|
||||
kDebug(180) << "Error stat'ing " << pathfn << " : " << perror;
|
||||
kDebug(180) << "Error stat'ing " << pathfn << " : " << ::strerror(errno);
|
||||
continue; // Couldn't stat (e.g. no read permissions)
|
||||
}
|
||||
isReg = S_ISREG (buff.st_mode);
|
||||
|
@ -701,7 +702,7 @@ static void lookupPrefix(const QString& prefix, const QString& relpath,
|
|||
QString pathfn = path + fn;
|
||||
KDE_struct_stat buff;
|
||||
if ( KDE::stat( fn, &buff ) != 0 ) {
|
||||
kDebug(180) << "Error stat'ing " << fn << " : " << perror;
|
||||
kDebug(180) << "Error stat'ing " << fn << " : " << ::strerror(errno);
|
||||
continue; // Couldn't stat (e.g. no read permissions)
|
||||
}
|
||||
isDir = S_ISDIR (buff.st_mode);
|
||||
|
|
|
@ -217,7 +217,7 @@ void testKDebug()
|
|||
ch = '\r';
|
||||
kDebug() << "QChar \\r: " << ch;
|
||||
kDebug() << "error on this line";
|
||||
kDebug(2 == 2) << "this is right " << perror;
|
||||
kDebug(2 == 2) << "this is right";
|
||||
kDebug() << "Before instance creation";
|
||||
kDebug(1202) << "Before instance creation";
|
||||
KComponentData i("kdebugtest");
|
||||
|
|
|
@ -160,7 +160,13 @@ QVariant WebPHandler::option(ImageOption option) const
|
|||
void WebPHandler::setOption(ImageOption option, const QVariant &value)
|
||||
{
|
||||
if (option == Quality) {
|
||||
quality = qBound(0, value.toInt(), 100);
|
||||
const int newquality = value.toInt();
|
||||
// -1 means default
|
||||
if (newquality == -1) {
|
||||
quality = 75;
|
||||
} else {
|
||||
quality = qBound(0, newquality, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <kmountpoint.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <grp.h>
|
||||
|
@ -547,7 +548,7 @@ void FileProtocol::del(const KUrl& url, bool isfile)
|
|||
if ((errno == EACCES) || (errno == EPERM)) {
|
||||
error(KIO::ERR_ACCESS_DENIED, path);
|
||||
} else {
|
||||
kDebug( 7101 ) << "could not rmdir " << perror;
|
||||
kDebug( 7101 ) << "could not rmdir " << ::strerror(errno);
|
||||
error(KIO::ERR_COULD_NOT_RMDIR, path);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue