Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/collections/mtpcollection/handler/MtpHandler.cpp
Show All 20 Lines | |||||
21 | #define DEBUG_PREFIX "MtpHandler" | 21 | #define DEBUG_PREFIX "MtpHandler" | ||
22 | 22 | | |||
23 | #include "MtpHandler.h" | 23 | #include "MtpHandler.h" | ||
24 | 24 | | |||
25 | #include "MtpCollection.h" | 25 | #include "MtpCollection.h" | ||
26 | #include "core/support/Debug.h" | 26 | #include "core/support/Debug.h" | ||
27 | 27 | | |||
28 | #include "core-impl/meta/file/File.h" // for KIO file handling | 28 | #include "core-impl/meta/file/File.h" // for KIO file handling | ||
29 | #include "core/interfaces/Logger.h" | 29 | #include "core/logger/Logger.h" | ||
30 | 30 | | |||
31 | #include <KIO/Job> | 31 | #include <KIO/Job> | ||
32 | #include <KIO/DeleteJob> | 32 | #include <KIO/DeleteJob> | ||
33 | #include "kjob.h" | 33 | #include "kjob.h" | ||
34 | #include <ThreadWeaver/ThreadWeaver> | 34 | #include <ThreadWeaver/ThreadWeaver> | ||
35 | #include <QUrl> | 35 | #include <QUrl> | ||
36 | 36 | | |||
37 | #include <QFileInfo> | 37 | #include <QFileInfo> | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 68 | { | |||
86 | // release device | 86 | // release device | ||
87 | 87 | | |||
88 | if ( m_device != 0 ) | 88 | if ( m_device != 0 ) | ||
89 | { | 89 | { | ||
90 | 90 | | |||
91 | LIBMTP_Release_Device( m_device ); | 91 | LIBMTP_Release_Device( m_device ); | ||
92 | /* possible race condition with statusbar destructor, | 92 | /* possible race condition with statusbar destructor, | ||
93 | will uncomment when fixed */ | 93 | will uncomment when fixed */ | ||
94 | //Amarok::Components::logger()->longMessage( | 94 | //Amarok::Logger::longMessage( | ||
95 | // i18n( "The MTP device %1 has been disconnected", prettyName() ), StatusBar::Information ); | 95 | // i18n( "The MTP device %1 has been disconnected", prettyName() ), StatusBar::Information ); | ||
96 | debug() << "Device released"; | 96 | debug() << "Device released"; | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | bool | 101 | bool | ||
102 | MtpHandler::isWritable() const | 102 | MtpHandler::isWritable() const | ||
▲ Show 20 Lines • Show All 251 Lines • ▼ Show 20 Line(s) | 346 | { | |||
354 | } | 354 | } | ||
355 | 355 | | |||
356 | // release device | 356 | // release device | ||
357 | if ( m_device != 0 ) | 357 | if ( m_device != 0 ) | ||
358 | { | 358 | { | ||
359 | LIBMTP_Release_Device( m_device ); | 359 | LIBMTP_Release_Device( m_device ); | ||
360 | /* possible race condition with statusbar destructor, | 360 | /* possible race condition with statusbar destructor, | ||
361 | will uncomment when fixed | 361 | will uncomment when fixed | ||
362 | Amarok::Components::logger()->longMessage( | 362 | Amarok::Logger::longMessage( | ||
363 | i18n( "The MTP device %1 has been disconnected", prettyName() ), | 363 | i18n( "The MTP device %1 has been disconnected", prettyName() ), | ||
364 | Amarok::Logger::Information | 364 | Amarok::Logger::Information | ||
365 | ); */ | 365 | ); */ | ||
366 | 366 | | |||
367 | debug() << "Device released"; | 367 | debug() << "Device released"; | ||
368 | } | 368 | } | ||
369 | } | 369 | } | ||
370 | 370 | | |||
▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | 587 | { | |||
595 | debug() << "delete this id : " << object_id; | 595 | debug() << "delete this id : " << object_id; | ||
596 | 596 | | |||
597 | 597 | | |||
598 | int status = LIBMTP_Delete_Object( m_device, object_id ); | 598 | int status = LIBMTP_Delete_Object( m_device, object_id ); | ||
599 | 599 | | |||
600 | if ( status != 0 ) | 600 | if ( status != 0 ) | ||
601 | { | 601 | { | ||
602 | debug() << "delete object failed"; | 602 | debug() << "delete object failed"; | ||
603 | Amarok::Components::logger()->longMessage( i18n( "Delete failed" ), | 603 | Amarok::Logger::longMessage( i18n( "Delete failed" ), | ||
604 | Amarok::Logger::Error | 604 | Amarok::Logger::Error | ||
605 | ); | 605 | ); | ||
606 | // return false; | 606 | // return false; | ||
607 | } | 607 | } | ||
608 | debug() << "object deleted"; | 608 | debug() << "object deleted"; | ||
609 | 609 | | |||
610 | // return true; | 610 | // return true; | ||
611 | 611 | | |||
▲ Show 20 Lines • Show All 920 Lines • Show Last 20 Lines |