mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
gwenview: log debug messages to special area
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a4017a3a68
commit
39b4708812
13 changed files with 59 additions and 179 deletions
|
@ -10,6 +10,8 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
|||
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5003)
|
||||
|
||||
## Dependencies
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads)
|
||||
|
|
|
@ -52,15 +52,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
struct ImageOpsContextManagerItem::Private
|
||||
{
|
||||
ImageOpsContextManagerItem* q;
|
||||
|
|
|
@ -51,15 +51,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This widget is capable of showing multiple lines of key/value pairs.
|
||||
*/
|
||||
|
@ -284,12 +275,12 @@ InfoContextManagerItem::~InfoContextManagerItem()
|
|||
|
||||
void InfoContextManagerItem::updateSideBarContent()
|
||||
{
|
||||
LOG("updateSideBarContent");
|
||||
kDebug() << "updateSideBarContent";
|
||||
if (!d->mGroup->isVisible()) {
|
||||
LOG("updateSideBarContent: not visible, not updating");
|
||||
kDebug() << "updateSideBarContent: not visible, not updating";
|
||||
return;
|
||||
}
|
||||
LOG("updateSideBarContent: really updating");
|
||||
kDebug() << "updateSideBarContent: really updating";
|
||||
|
||||
KFileItemList itemList = contextManager()->selectedFileItemList();
|
||||
if (itemList.count() == 0) {
|
||||
|
|
|
@ -98,15 +98,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
static const int BROWSE_PRELOAD_DELAY = 1000;
|
||||
static const int VIEW_PRELOAD_DELAY = 100;
|
||||
|
||||
|
|
|
@ -32,15 +32,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
struct PreloaderPrivate
|
||||
{
|
||||
Preloader* q;
|
||||
|
@ -70,7 +61,7 @@ Preloader::~Preloader()
|
|||
|
||||
void Preloader::preload(const KUrl& url, const QSize& size)
|
||||
{
|
||||
LOG("url=" << url);
|
||||
kDebug() << "url=" << url;
|
||||
if (d->mDocument) {
|
||||
disconnect(d->mDocument.data(), 0, this, 0);
|
||||
}
|
||||
|
@ -81,7 +72,7 @@ void Preloader::preload(const KUrl& url, const QSize& size)
|
|||
SLOT(doPreload()));
|
||||
|
||||
if (d->mDocument->size().isValid()) {
|
||||
LOG("size is already available");
|
||||
kDebug() << "size is already available";
|
||||
doPreload();
|
||||
}
|
||||
}
|
||||
|
@ -93,13 +84,13 @@ void Preloader::doPreload()
|
|||
}
|
||||
|
||||
if (d->mDocument->loadingState() == Document::LoadingFailed) {
|
||||
LOG("loading failed");
|
||||
kDebug() << "loading failed";
|
||||
d->forgetDocument();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!d->mDocument->size().isValid()) {
|
||||
LOG("size not available yet");
|
||||
kDebug() << "size not available yet";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,10 +100,10 @@ void Preloader::doPreload()
|
|||
);
|
||||
|
||||
if (zoom < Document::maxDownSampledZoom()) {
|
||||
LOG("preloading down sampled, zoom=" << zoom);
|
||||
kDebug() << "preloading down sampled, zoom=" << zoom;
|
||||
d->mDocument->prepareDownSampledImageForZoom(zoom);
|
||||
} else {
|
||||
LOG("preloading full image");
|
||||
kDebug() << "preloading full image";
|
||||
d->mDocument->startLoadingFullImage();
|
||||
}
|
||||
d->forgetDocument();
|
||||
|
|
|
@ -61,15 +61,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
const int ViewMainPage::MaxViewCount = 6;
|
||||
|
||||
static QString rgba(const QColor &color)
|
||||
|
@ -584,7 +575,7 @@ KUrl ViewMainPage::url() const
|
|||
Document::Ptr ViewMainPage::currentDocument() const
|
||||
{
|
||||
if (!d->currentView()) {
|
||||
LOG("!d->documentView()");
|
||||
kDebug() << "!d->documentView()";
|
||||
return Document::Ptr();
|
||||
}
|
||||
|
||||
|
|
|
@ -45,17 +45,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_LOG
|
||||
|
||||
static void logQueue(DocumentPrivate* d)
|
||||
{
|
||||
#define PREFIX " QUEUE: "
|
||||
|
@ -78,15 +67,9 @@ static void logQueue(DocumentPrivate* d)
|
|||
}
|
||||
|
||||
#define LOG_QUEUE(msg, d) \
|
||||
LOG(msg); \
|
||||
kDebug() << msg; \
|
||||
logQueue(d)
|
||||
|
||||
#else
|
||||
|
||||
#define LOG_QUEUE(msg, d)
|
||||
|
||||
#endif
|
||||
|
||||
//- DocumentPrivate ---------------------------------------
|
||||
void DocumentPrivate::scheduleImageLoading(int invertedZoom)
|
||||
{
|
||||
|
@ -97,10 +80,10 @@ void DocumentPrivate::scheduleImageLoading(int invertedZoom)
|
|||
|
||||
void DocumentPrivate::scheduleImageDownSampling(int invertedZoom)
|
||||
{
|
||||
LOG("invertedZoom=" << invertedZoom);
|
||||
kDebug() << "invertedZoom=" << invertedZoom;
|
||||
DownSamplingJob* job = qobject_cast<DownSamplingJob*>(mCurrentJob.data());
|
||||
if (job && job->mInvertedZoom == invertedZoom) {
|
||||
LOG("Current job is already doing it");
|
||||
kDebug() << "Current job is already doing it";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -113,10 +96,10 @@ void DocumentPrivate::scheduleImageDownSampling(int invertedZoom)
|
|||
}
|
||||
if (job->mInvertedZoom == invertedZoom) {
|
||||
// Already scheduled, nothing to do
|
||||
LOG("Already scheduled");
|
||||
kDebug() << "Already scheduled";
|
||||
return;
|
||||
} else {
|
||||
LOG("Removing downsampling job");
|
||||
kDebug() << "Removing downsampling job";
|
||||
mJobQueue.erase(it);
|
||||
delete job;
|
||||
}
|
||||
|
@ -235,7 +218,7 @@ Document::LoadingState Document::loadingState() const
|
|||
void Document::switchToImpl(AbstractDocumentImpl* impl)
|
||||
{
|
||||
Q_ASSERT(impl);
|
||||
LOG("old impl:" << d->mImpl << "new impl:" << impl);
|
||||
kDebug() << "old impl:" << d->mImpl << "new impl:" << impl;
|
||||
if (d->mImpl) {
|
||||
d->mImpl->deleteLater();
|
||||
}
|
||||
|
@ -437,11 +420,11 @@ bool Document::prepareDownSampledImageForZoom(qreal zoom)
|
|||
|
||||
int invertedZoom = invertedZoomForZoom(zoom);
|
||||
if (d->mDownSampledImageMap.contains(invertedZoom)) {
|
||||
LOG("downSampledImageForZoom=" << zoom << "invertedZoom=" << invertedZoom << "ready");
|
||||
kDebug() << "downSampledImageForZoom=" << zoom << "invertedZoom=" << invertedZoom << "ready";
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG("downSampledImageForZoom=" << zoom << "invertedZoom=" << invertedZoom << "not ready");
|
||||
kDebug() << "downSampledImageForZoom=" << zoom << "invertedZoom=" << invertedZoom << "not ready";
|
||||
if (loadingState() == LoadingFailed) {
|
||||
kWarning() << "Image has failed to load, not doing anything";
|
||||
return false;
|
||||
|
@ -510,7 +493,7 @@ void Document::stopAnimation()
|
|||
|
||||
void Document::enqueueJob(DocumentJob* job)
|
||||
{
|
||||
LOG("job=" << job);
|
||||
kDebug() << "job=" << job;
|
||||
job->setDocument(Ptr(this));
|
||||
connect(job, SIGNAL(finished(KJob*)),
|
||||
SLOT(slotJobFinished(KJob*)));
|
||||
|
@ -518,7 +501,7 @@ void Document::enqueueJob(DocumentJob* job)
|
|||
d->mJobQueue.enqueue(job);
|
||||
} else {
|
||||
d->mCurrentJob = job;
|
||||
LOG("Starting first job");
|
||||
kDebug() << "Starting first job";
|
||||
job->start();
|
||||
busyChanged(d->mUrl, true);
|
||||
}
|
||||
|
@ -527,16 +510,16 @@ void Document::enqueueJob(DocumentJob* job)
|
|||
|
||||
void Document::slotJobFinished(KJob* job)
|
||||
{
|
||||
LOG("job=" << job);
|
||||
kDebug() << "job=" << job;
|
||||
GV_RETURN_IF_FAIL(job == d->mCurrentJob.data());
|
||||
|
||||
if (d->mJobQueue.isEmpty()) {
|
||||
LOG("All done");
|
||||
kDebug() << "All done";
|
||||
d->mCurrentJob.clear();
|
||||
busyChanged(d->mUrl, false);
|
||||
allTasksDone();
|
||||
} else {
|
||||
LOG("Starting next job");
|
||||
kDebug() << "Starting next job";
|
||||
d->mCurrentJob = d->mJobQueue.dequeue();
|
||||
GV_RETURN_IF_FAIL(d->mCurrentJob);
|
||||
d->mCurrentJob.data()->start();
|
||||
|
|
|
@ -35,15 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
inline int getMaxUnreferencedImages()
|
||||
{
|
||||
int defaultValue = 3;
|
||||
|
@ -109,16 +100,14 @@ struct DocumentFactoryPrivate
|
|||
unreferencedIt = unreferencedImages.erase(unreferencedIt))
|
||||
{
|
||||
KUrl url = unreferencedIt.value();
|
||||
LOG("Collecting" << url);
|
||||
kDebug() << "Collecting" << url;
|
||||
it = map.find(url);
|
||||
Q_ASSERT(it != map.end());
|
||||
delete it.value();
|
||||
map.erase(it);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_LOG
|
||||
logDocumentMap(map);
|
||||
#endif
|
||||
}
|
||||
|
||||
void logDocumentMap(const DocumentMap& map)
|
||||
|
@ -168,7 +157,7 @@ Document::Ptr DocumentFactory::load(const KUrl& url)
|
|||
DocumentMap::Iterator it = d->mDocumentMap.find(url);
|
||||
|
||||
if (it != d->mDocumentMap.end()) {
|
||||
LOG(url.fileName() << "url in mDocumentMap");
|
||||
kDebug() << url.fileName() << "url in mDocumentMap";
|
||||
info = it.value();
|
||||
info->mLastAccess = QDateTime::currentDateTime();
|
||||
return info->mDocument;
|
||||
|
@ -177,7 +166,7 @@ Document::Ptr DocumentFactory::load(const KUrl& url)
|
|||
// At this point we couldn't find the document in the map
|
||||
|
||||
// Start loading the document
|
||||
LOG(url.fileName() << "loading");
|
||||
kDebug() << url.fileName() << "loading";
|
||||
Document* doc = new Document(url);
|
||||
connect(doc, SIGNAL(loaded(KUrl)),
|
||||
SLOT(slotLoaded(KUrl)));
|
||||
|
|
|
@ -56,15 +56,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
const int HEADER_SIZE = 256;
|
||||
|
||||
struct LoadingDocumentImplPrivate
|
||||
|
@ -102,8 +93,7 @@ struct LoadingDocumentImplPrivate
|
|||
mimeType = KMimeType::findByContent(mData)->name();
|
||||
}
|
||||
MimeTypeUtils::Kind kind = MimeTypeUtils::mimeTypeKind(mimeType);
|
||||
LOG("mimeType:" << mimeType);
|
||||
LOG("kind:" << kind);
|
||||
kDebug() << "mimeType:" << mimeType << ", kind:" << kind;
|
||||
q->setDocumentKind(kind);
|
||||
|
||||
switch (kind) {
|
||||
|
@ -151,7 +141,7 @@ struct LoadingDocumentImplPrivate
|
|||
|
||||
void startImageDataLoading()
|
||||
{
|
||||
LOG("");
|
||||
kDebug() << "Starting image loading";
|
||||
Q_ASSERT(mMetaInfoLoaded);
|
||||
Q_ASSERT(mImageDataInvertedZoom != 0);
|
||||
Q_ASSERT(!mImageDataFutureWatcher->isRunning());
|
||||
|
@ -165,7 +155,7 @@ struct LoadingDocumentImplPrivate
|
|||
|
||||
bool loadMetaInfo()
|
||||
{
|
||||
LOG("mFormatHint" << mFormatHint);
|
||||
kDebug() << "mFormatHint" << mFormatHint;
|
||||
QBuffer buffer;
|
||||
buffer.setBuffer(&mData);
|
||||
buffer.open(QIODevice::ReadOnly);
|
||||
|
@ -191,10 +181,10 @@ struct LoadingDocumentImplPrivate
|
|||
|
||||
mFormat = reader.format();
|
||||
|
||||
LOG("mFormat" << mFormat);
|
||||
kDebug() << "mFormat" << mFormat;
|
||||
GV_RETURN_VALUE_IF_FAIL(!mFormat.isEmpty(), false);
|
||||
|
||||
LOG("mImageSize" << mImageSize);
|
||||
kDebug() << "mImageSize" << mImageSize;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -206,7 +196,7 @@ struct LoadingDocumentImplPrivate
|
|||
buffer.open(QIODevice::ReadOnly);
|
||||
QImageReader reader(&buffer, mFormat);
|
||||
|
||||
LOG("mImageDataInvertedZoom=" << mImageDataInvertedZoom);
|
||||
kDebug() << "mImageDataInvertedZoom=" << mImageDataInvertedZoom;
|
||||
if (mImageSize.isValid()
|
||||
&& mImageDataInvertedZoom != 1
|
||||
&& reader.supportsOption(QImageIOHandler::ScaledSize)
|
||||
|
@ -215,16 +205,16 @@ struct LoadingDocumentImplPrivate
|
|||
// image size
|
||||
QSize size = reader.size() / mImageDataInvertedZoom;
|
||||
if (!size.isEmpty()) {
|
||||
LOG("Setting scaled size to" << size);
|
||||
kDebug() << "Setting scaled size to" << size;
|
||||
reader.setScaledSize(size);
|
||||
} else {
|
||||
LOG("Not setting scaled size as it is empty" << size);
|
||||
kDebug() << "Not setting scaled size as it is empty" << size;
|
||||
}
|
||||
}
|
||||
|
||||
bool ok = reader.read(&mImage);
|
||||
if (!ok) {
|
||||
LOG("QImageReader::read() failed");
|
||||
kDebug() << "QImageReader::read() failed";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -232,7 +222,7 @@ struct LoadingDocumentImplPrivate
|
|||
&& reader.nextImageDelay() > 0 // Assume delay == 0 <=> only one frame
|
||||
) {
|
||||
if (reader.imageCount() > 0) {
|
||||
LOG("Really an animated image");
|
||||
kDebug() << "Really an animated image";
|
||||
mAnimated = true;
|
||||
return;
|
||||
}
|
||||
|
@ -247,10 +237,10 @@ struct LoadingDocumentImplPrivate
|
|||
* Decoding the next frame is the only reliable way I found to
|
||||
* detect an animated images
|
||||
*/
|
||||
LOG("May be an animated image. delay:" << reader.nextImageDelay());
|
||||
kDebug() << "May be an animated image. delay:" << reader.nextImageDelay();
|
||||
QImage nextImage;
|
||||
if (reader.read(&nextImage)) {
|
||||
LOG("Really an animated image (more than one frame)");
|
||||
kDebug() << "Really an animated image (more than one frame)";
|
||||
mAnimated = true;
|
||||
} else {
|
||||
kWarning() << q->document()->url() << "is not really an animated image (only one frame)";
|
||||
|
@ -272,7 +262,6 @@ LoadingDocumentImpl::LoadingDocumentImpl(Document* document)
|
|||
|
||||
LoadingDocumentImpl::~LoadingDocumentImpl()
|
||||
{
|
||||
LOG("");
|
||||
// Disconnect watchers to make sure they do not trigger further work
|
||||
if (d->mMetaInfoFutureWatcher) {
|
||||
d->mMetaInfoFutureWatcher->disconnect();
|
||||
|
@ -327,11 +316,11 @@ void LoadingDocumentImpl::init()
|
|||
void LoadingDocumentImpl::loadImage(int invertedZoom)
|
||||
{
|
||||
if (d->mImageDataInvertedZoom == invertedZoom) {
|
||||
LOG("Already loading an image at invertedZoom=" << invertedZoom);
|
||||
kDebug() << "Already loading an image at invertedZoom=" << invertedZoom;
|
||||
return;
|
||||
}
|
||||
if (d->mImageDataInvertedZoom == 1) {
|
||||
LOG("Ignoring request: we are loading a full image");
|
||||
kDebug() << "Ignoring request: we are loading a full image";
|
||||
return;
|
||||
}
|
||||
if (d->mImageDataFutureWatcher) {
|
||||
|
@ -388,7 +377,7 @@ Document::LoadingState LoadingDocumentImpl::loadingState() const
|
|||
|
||||
void LoadingDocumentImpl::slotMetaInfoLoaded()
|
||||
{
|
||||
LOG("");
|
||||
kDebug() << "Meta information loaded";
|
||||
Q_ASSERT(!d->mMetaInfoFutureWatcher->isRunning());
|
||||
if (!d->mMetaInfoFutureWatcher->result()) {
|
||||
setDocumentErrorString(
|
||||
|
@ -417,7 +406,7 @@ void LoadingDocumentImpl::slotMetaInfoLoaded()
|
|||
|
||||
void LoadingDocumentImpl::slotImageLoaded()
|
||||
{
|
||||
LOG("");
|
||||
kDebug() << "Image loaded";
|
||||
if (d->mImage.isNull()) {
|
||||
setDocumentErrorString(
|
||||
i18nc("@info", "Loading image failed.")
|
||||
|
@ -444,14 +433,14 @@ void LoadingDocumentImpl::slotImageLoaded()
|
|||
}
|
||||
|
||||
if (d->mImageDataInvertedZoom != 1 && d->mImage.size() != d->mImageSize) {
|
||||
LOG("Loaded a down sampled image");
|
||||
kDebug() << "Loaded a down sampled image";
|
||||
d->mDownSampledImageLoaded = true;
|
||||
// We loaded a down sampled image
|
||||
setDocumentDownSampledImage(d->mImage, d->mImageDataInvertedZoom);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Loaded a full image");
|
||||
kDebug() << "Loaded a full image";
|
||||
setDocumentImage(d->mImage);
|
||||
DocumentLoadedImpl* impl;
|
||||
impl = new DocumentLoadedImpl(
|
||||
|
|
|
@ -62,15 +62,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
static const qreal REAL_DELTA = 0.001;
|
||||
static const qreal MAXIMUM_ZOOM_VALUE = qreal(DocumentView::MaximumZoom);
|
||||
|
||||
|
@ -346,7 +337,7 @@ void DocumentView::createAdapterForDocument()
|
|||
const MimeTypeUtils::Kind documentKind = d->mDocument->kind();
|
||||
if (d->mAdapter && documentKind == d->mAdapter->kind() && documentKind != MimeTypeUtils::KIND_UNKNOWN) {
|
||||
// Do not reuse for KIND_UNKNOWN: we may need to change the message
|
||||
LOG("Reusing current adapter");
|
||||
kDebug() << "Reusing current adapter";
|
||||
return;
|
||||
}
|
||||
AbstractDocumentViewAdapter* adapter = 0;
|
||||
|
|
|
@ -30,15 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include <lib/document/document.h>
|
||||
#include <lib/paintutils.h>
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
namespace Gwenview
|
||||
{
|
||||
|
||||
|
@ -92,7 +83,7 @@ void ImageScaler::setTransformationMode(Qt::TransformationMode mode)
|
|||
|
||||
void ImageScaler::setDestinationRegion(const QRegion& region)
|
||||
{
|
||||
LOG(region);
|
||||
kDebug() << region;
|
||||
d->mRegion = region;
|
||||
if (d->mRegion.isEmpty()) {
|
||||
return;
|
||||
|
@ -107,21 +98,21 @@ void ImageScaler::doScale()
|
|||
{
|
||||
if (d->mZoom < Document::maxDownSampledZoom()) {
|
||||
if (!d->mDocument->prepareDownSampledImageForZoom(d->mZoom)) {
|
||||
LOG("Asked for a down sampled image");
|
||||
kDebug() << "Asked for a down sampled image";
|
||||
return;
|
||||
}
|
||||
} else if (d->mDocument->image().isNull()) {
|
||||
LOG("Asked for the full image");
|
||||
kDebug() << "Asked for the full image";
|
||||
d->mDocument->startLoadingFullImage();
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Starting");
|
||||
kDebug() << "Starting";
|
||||
Q_FOREACH(const QRect & rect, d->mRegion.rects()) {
|
||||
LOG(rect);
|
||||
kDebug() << rect;
|
||||
scaleRect(rect);
|
||||
}
|
||||
LOG("Done");
|
||||
kDebug() << "Done";
|
||||
}
|
||||
|
||||
void ImageScaler::scaleRect(const QRect& rect)
|
||||
|
|
|
@ -37,15 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
enum State {
|
||||
Stopped,
|
||||
Started,
|
||||
|
@ -135,7 +126,7 @@ struct SlideShowPrivate
|
|||
|
||||
void doStart()
|
||||
{
|
||||
LOG("mState = Started");
|
||||
kDebug() << "mState = Started";
|
||||
mTimer->start();
|
||||
mState = Started;
|
||||
}
|
||||
|
@ -210,7 +201,7 @@ void SlideShow::setInterval(int intervalInSeconds)
|
|||
|
||||
void SlideShow::stop()
|
||||
{
|
||||
LOG("Stopping timer");
|
||||
kDebug() << "Stopping timer";
|
||||
d->mTimer->stop();
|
||||
d->mState = Stopped;
|
||||
stateChanged(false);
|
||||
|
@ -218,7 +209,6 @@ void SlideShow::stop()
|
|||
|
||||
void SlideShow::resumeAndGoToNextUrl()
|
||||
{
|
||||
LOG("");
|
||||
if (d->mState == WaitForEndOfUrl) {
|
||||
goToNextUrl();
|
||||
}
|
||||
|
@ -226,9 +216,8 @@ void SlideShow::resumeAndGoToNextUrl()
|
|||
|
||||
void SlideShow::goToNextUrl()
|
||||
{
|
||||
LOG("");
|
||||
KUrl url = d->findNextUrl();
|
||||
LOG("url:" << url);
|
||||
kDebug() << "Next url:" << url;
|
||||
if (!url.isValid()) {
|
||||
stop();
|
||||
return;
|
||||
|
@ -238,7 +227,7 @@ void SlideShow::goToNextUrl()
|
|||
|
||||
void SlideShow::setCurrentUrl(const KUrl& url)
|
||||
{
|
||||
LOG(url);
|
||||
kDebug() << "Current url" << url;
|
||||
if (d->mCurrentUrl == url) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -54,15 +54,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
namespace Gwenview
|
||||
{
|
||||
|
||||
#undef ENABLE_LOG
|
||||
#undef LOG
|
||||
//#define ENABLE_LOG
|
||||
#ifdef ENABLE_LOG
|
||||
#define LOG(x) kDebug() << x
|
||||
#else
|
||||
#define LOG(x) ;
|
||||
#endif
|
||||
|
||||
/** How many msec to wait before starting to smooth thumbnails */
|
||||
static const int THUMBNAIL_DELAY = 500;
|
||||
|
||||
|
@ -73,7 +64,7 @@ static const QSize maxThumbSize(ThumbnailView::MaxThumbnailSize, ThumbnailView::
|
|||
static KFileItem fileItemForIndex(const QModelIndex& index)
|
||||
{
|
||||
if (!index.isValid()) {
|
||||
LOG("Invalid index");
|
||||
kDebug() << "Invalid index";
|
||||
return KFileItem();
|
||||
}
|
||||
QVariant data = index.data(KDirModel::FileItemRole);
|
||||
|
@ -562,7 +553,7 @@ QPixmap ThumbnailView::thumbnailForIndex(const QModelIndex& index, QSize* fullSi
|
|||
{
|
||||
KFileItem item = fileItemForIndex(index);
|
||||
if (item.isNull()) {
|
||||
LOG("Invalid item");
|
||||
kDebug() << "Invalid item";
|
||||
if (fullSize) {
|
||||
*fullSize = QSize();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue