Use c++11 instead of boost where possible.
This commit is contained in:
parent
7c102ace45
commit
d309d4ab27
@ -20,24 +20,6 @@ if (APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
|
||||
check_cxx_source_compiles(
|
||||
"#include <unordered_map>
|
||||
int main() {
|
||||
std::unordered_map<int, int> m;
|
||||
return 0;
|
||||
}
|
||||
"
|
||||
USE_STD_UNORDERED_MAP)
|
||||
check_cxx_source_compiles(
|
||||
"int main() {
|
||||
[](){}();
|
||||
}
|
||||
"
|
||||
HAVE_LAMBDAS)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
set(LINUX 1)
|
||||
endif (UNIX AND NOT APPLE)
|
||||
|
@ -33,7 +33,7 @@ ClosureBase::~ClosureBase() {
|
||||
CallbackClosure::CallbackClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
boost::function<void()> callback)
|
||||
std::function<void()> callback)
|
||||
: ClosureBase(new ObjectHelper(sender, signal, this)),
|
||||
callback_(callback) {
|
||||
}
|
||||
@ -67,7 +67,7 @@ void Unpack(QList<QGenericArgument>*) {}
|
||||
_detail::ClosureBase* NewClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
boost::function<void()> callback) {
|
||||
std::function<void()> callback) {
|
||||
return new _detail::CallbackClosure(
|
||||
sender, signal, callback);
|
||||
}
|
||||
|
@ -19,22 +19,18 @@
|
||||
#define CLOSURE_H
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <QMetaMethod>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
namespace _detail {
|
||||
|
||||
class ObjectHelper;
|
||||
|
||||
// Interface for ObjectHelper to call on signal emission.
|
||||
class ClosureBase : boost::noncopyable {
|
||||
class ClosureBase {
|
||||
public:
|
||||
virtual ~ClosureBase();
|
||||
virtual void Invoke() = 0;
|
||||
@ -45,6 +41,9 @@ class ClosureBase : boost::noncopyable {
|
||||
protected:
|
||||
explicit ClosureBase(ObjectHelper*);
|
||||
ObjectHelper* helper_;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(ClosureBase);
|
||||
};
|
||||
|
||||
// QObject helper as templated QObjects do not work.
|
||||
@ -62,7 +61,7 @@ class ObjectHelper : public QObject {
|
||||
void Invoked();
|
||||
|
||||
private:
|
||||
boost::scoped_ptr<ClosureBase> closure_;
|
||||
std::unique_ptr<ClosureBase> closure_;
|
||||
Q_DISABLE_COPY(ObjectHelper);
|
||||
};
|
||||
|
||||
@ -92,8 +91,8 @@ class Closure : public ClosureBase {
|
||||
const char* slot,
|
||||
const Args&... args)
|
||||
: ClosureBase(new ObjectHelper(sender, signal, this)),
|
||||
// boost::bind is the easiest way to store an argument list.
|
||||
function_(boost::bind(&Closure<Args...>::Call, this, args...)),
|
||||
// std::bind is the easiest way to store an argument list.
|
||||
function_(std::bind(&Closure<Args...>::Call, this, args...)),
|
||||
receiver_(receiver) {
|
||||
const QMetaObject* meta_receiver = receiver->metaObject();
|
||||
QByteArray normalised_slot = QMetaObject::normalizedSignature(slot + 1);
|
||||
@ -126,7 +125,7 @@ class Closure : public ClosureBase {
|
||||
arg_list.size() > 9 ? arg_list[9] : QGenericArgument());
|
||||
}
|
||||
|
||||
boost::function<void()> function_;
|
||||
std::function<void()> function_;
|
||||
QObject* receiver_;
|
||||
QMetaMethod slot_;
|
||||
};
|
||||
@ -158,12 +157,12 @@ class CallbackClosure : public ClosureBase {
|
||||
CallbackClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
boost::function<void()> callback);
|
||||
std::function<void()> callback);
|
||||
|
||||
virtual void Invoke();
|
||||
|
||||
private:
|
||||
boost::function<void()> callback_;
|
||||
std::function<void()> callback_;
|
||||
};
|
||||
|
||||
} // namespace _detail
|
||||
@ -194,15 +193,15 @@ _detail::ClosureBase* NewClosure(
|
||||
_detail::ClosureBase* NewClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
boost::function<void()> callback);
|
||||
std::function<void()> callback);
|
||||
|
||||
template <typename... Args>
|
||||
_detail::ClosureBase* NewClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
boost::function<void(Args...)> callback,
|
||||
std::function<void(Args...)> callback,
|
||||
const Args&... args) {
|
||||
return NewClosure(sender, signal, boost::bind(callback, args...));
|
||||
return NewClosure(sender, signal, std::bind(callback, args...));
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
@ -211,7 +210,7 @@ _detail::ClosureBase* NewClosure(
|
||||
const char* signal,
|
||||
void (*callback)(Args...),
|
||||
const Args&... args) {
|
||||
return NewClosure(sender, signal, boost::bind(callback, args...));
|
||||
return NewClosure(sender, signal, std::bind(callback, args...));
|
||||
}
|
||||
|
||||
template <typename T, typename Unused, typename... Args>
|
||||
@ -220,7 +219,7 @@ _detail::ClosureBase* NewClosure(
|
||||
const char* signal,
|
||||
T* receiver, Unused (T::*callback)(Args...),
|
||||
const Args&... args) {
|
||||
return NewClosure(sender, signal, boost::bind(callback, receiver, args...));
|
||||
return NewClosure(sender, signal, std::bind(callback, receiver, args...));
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,8 +18,7 @@
|
||||
#ifndef CONCURRENTRUN_H
|
||||
#define CONCURRENTRUN_H
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <functional>
|
||||
|
||||
#include <QFuture>
|
||||
#include <QRunnable>
|
||||
@ -69,9 +68,9 @@ class ThreadFunctorBase : public QFutureInterface<ReturnType>, public QRunnable
|
||||
template <typename ReturnType, typename... Args>
|
||||
class ThreadFunctor : public ThreadFunctorBase<ReturnType> {
|
||||
public:
|
||||
ThreadFunctor(boost::function<ReturnType (Args...)> function,
|
||||
ThreadFunctor(std::function<ReturnType (Args...)> function,
|
||||
Args... args)
|
||||
: function_(boost::bind(function, args...)) {
|
||||
: function_(std::bind(function, args...)) {
|
||||
}
|
||||
|
||||
virtual void run() {
|
||||
@ -80,16 +79,16 @@ class ThreadFunctor : public ThreadFunctorBase<ReturnType> {
|
||||
}
|
||||
|
||||
private:
|
||||
boost::function<ReturnType()> function_;
|
||||
std::function<ReturnType()> function_;
|
||||
};
|
||||
|
||||
// Partial specialisation for void return type.
|
||||
template <typename... Args>
|
||||
class ThreadFunctor <void, Args...> : public ThreadFunctorBase<void> {
|
||||
public:
|
||||
ThreadFunctor(boost::function<void (Args...)> function,
|
||||
ThreadFunctor(std::function<void (Args...)> function,
|
||||
Args... args)
|
||||
: function_(boost::bind(function, args...)) {
|
||||
: function_(std::bind(function, args...)) {
|
||||
}
|
||||
|
||||
virtual void run() {
|
||||
@ -98,7 +97,7 @@ class ThreadFunctor <void, Args...> : public ThreadFunctorBase<void> {
|
||||
}
|
||||
|
||||
private:
|
||||
boost::function<void()> function_;
|
||||
std::function<void()> function_;
|
||||
};
|
||||
|
||||
|
||||
@ -111,7 +110,7 @@ namespace ConcurrentRun {
|
||||
template <typename ReturnType>
|
||||
QFuture<ReturnType> Run(
|
||||
QThreadPool* threadpool,
|
||||
boost::function<ReturnType ()> function) {
|
||||
std::function<ReturnType ()> function) {
|
||||
return (new ThreadFunctor<ReturnType>(function))->Start(threadpool);
|
||||
}
|
||||
|
||||
@ -119,7 +118,7 @@ namespace ConcurrentRun {
|
||||
template <typename ReturnType, typename... Args>
|
||||
QFuture<ReturnType> Run(
|
||||
QThreadPool* threadpool,
|
||||
boost::function<ReturnType (Args...)> function,
|
||||
std::function<ReturnType (Args...)> function,
|
||||
const Args&... args) {
|
||||
return (new ThreadFunctor<ReturnType, Args...>(
|
||||
function, args...))->Start(threadpool);
|
||||
@ -132,7 +131,7 @@ namespace ConcurrentRun {
|
||||
ReturnType (*function) (Args...),
|
||||
const Args&... args) {
|
||||
return Run(
|
||||
threadpool, boost::function<ReturnType (Args...)>(function), args...);
|
||||
threadpool, std::function<ReturnType (Args...)>(function), args...);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,13 @@
|
||||
|
||||
#include "fmpsparser.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <QStringList>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
FMPSParser::FMPSParser() :
|
||||
// The float regex ends with (?:$|(?=::|;;)) to ensure it matches all the way
|
||||
@ -105,12 +108,14 @@ int FMPSParser::ParseValueRef(const QStringRef& data, QVariant* ret) const {
|
||||
|
||||
// Parses an inner list - a list of values
|
||||
int FMPSParser::ParseListRef(const QStringRef& data, QVariantList* ret) const {
|
||||
return ParseContainer<':'>(data, boost::bind(&FMPSParser::ParseValueRef, this, _1, _2), ret);
|
||||
return ParseContainer<':'>(
|
||||
data, std::bind(&FMPSParser::ParseValueRef, this, _1, _2), ret);
|
||||
}
|
||||
|
||||
// Parses an outer list - a list of lists
|
||||
int FMPSParser::ParseListListRef(const QStringRef& data, Result* ret) const {
|
||||
return ParseContainer<';'>(data, boost::bind(&FMPSParser::ParseListRef, this, _1, _2), ret);
|
||||
return ParseContainer<';'>(
|
||||
data, std::bind(&FMPSParser::ParseListRef, this, _1, _2), ret);
|
||||
}
|
||||
|
||||
// Convenience functions that take QStrings instead of QStringRefs. Use the
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include "tagreader.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QFileInfo>
|
||||
@ -51,15 +53,11 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "fmpsparser.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/messagehandler.h"
|
||||
#include "core/timeconstants.h"
|
||||
|
||||
using boost::scoped_ptr;
|
||||
|
||||
// Taglib added support for FLAC pictures in 1.7.0
|
||||
#if (TAGLIB_MAJOR_VERSION > 1) || (TAGLIB_MAJOR_VERSION == 1 && TAGLIB_MINOR_VERSION >= 7)
|
||||
# define TAGLIB_HAS_FLAC_PICTURELIST
|
||||
@ -123,7 +121,7 @@ void TagReader::ReadFile(const QString& filename,
|
||||
song->set_mtime(info.lastModified().toTime_t());
|
||||
song->set_ctime(info.created().toTime_t());
|
||||
|
||||
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
if(fileref->isNull()) {
|
||||
qLog(Info) << "TagLib hasn't been able to read " << filename << " file";
|
||||
return;
|
||||
@ -530,7 +528,7 @@ bool TagReader::SaveFile(const QString& filename,
|
||||
|
||||
qLog(Debug) << "Saving tags to" << filename;
|
||||
|
||||
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
|
||||
if (!fileref || fileref->isNull()) // The file probably doesn't exist
|
||||
return false;
|
||||
@ -591,7 +589,7 @@ bool TagReader::SaveSongStatisticsToFile(const QString& filename,
|
||||
|
||||
qLog(Debug) << "Saving song statistics tags to" << filename;
|
||||
|
||||
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
|
||||
if (!fileref || fileref->isNull()) // The file probably doesn't exist
|
||||
return false;
|
||||
@ -647,7 +645,7 @@ bool TagReader::SaveSongRatingToFile(const QString& filename,
|
||||
|
||||
qLog(Debug) << "Saving song rating tags to" << filename;
|
||||
|
||||
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
|
||||
if (!fileref || fileref->isNull()) // The file probably doesn't exist
|
||||
return false;
|
||||
@ -749,7 +747,7 @@ void TagReader::SetTextFrame(const char* id, const std::string& value,
|
||||
bool TagReader::IsMediaFile(const QString& filename) const {
|
||||
qLog(Debug) << "Checking for valid file" << filename;
|
||||
|
||||
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
|
||||
return !fileref->isNull() && fileref->tag();
|
||||
}
|
||||
|
||||
@ -865,7 +863,7 @@ bool TagReader::ReadCloudFile(const QUrl& download_url,
|
||||
CloudStream* stream = new CloudStream(
|
||||
download_url, title, size, authorisation_header, network_);
|
||||
stream->Precache();
|
||||
scoped_ptr<TagLib::File> tag;
|
||||
std::unique_ptr<TagLib::File> tag;
|
||||
if (mime_type == "audio/mpeg" && title.endsWith(".mp3")) {
|
||||
tag.reset(new TagLib::MPEG::File(
|
||||
stream, // Takes ownership.
|
||||
|
@ -25,6 +25,7 @@ if (QT_VERSION_MINOR GREATER 5)
|
||||
endif(QT_VERSION_MINOR GREATER 7)
|
||||
endif(QT_VERSION_MINOR GREATER 5)
|
||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
|
||||
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
|
||||
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
include_directories(${GLIB_INCLUDE_DIRS})
|
||||
|
@ -46,7 +46,6 @@
|
||||
#cmakedefine TAGLIB_HAS_OPUS
|
||||
#cmakedefine USE_INSTALL_PREFIX
|
||||
#cmakedefine USE_SYSTEM_PROJECTM
|
||||
#cmakedefine USE_STD_UNORDERED_MAP
|
||||
#cmakedefine HAVE_LAMBDAS
|
||||
|
||||
#endif // CONFIG_H_IN
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef CRASHREPORTING_H
|
||||
#define CRASHREPORTING_H
|
||||
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <QObject>
|
||||
|
||||
class QFile;
|
||||
class QNetworkAccessManager;
|
||||
@ -64,7 +64,7 @@ private:
|
||||
static const char* kSendCrashReportOption;
|
||||
static char* sPath;
|
||||
|
||||
boost::scoped_ptr<google_breakpad::ExceptionHandler> handler_;
|
||||
std::unique_ptr<google_breakpad::ExceptionHandler> handler_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -16,18 +16,19 @@
|
||||
*/
|
||||
|
||||
#include "deletefiles.h"
|
||||
#include "musicstorage.h"
|
||||
#include "taskmanager.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <QUrl>
|
||||
|
||||
#include "musicstorage.h"
|
||||
#include "taskmanager.h"
|
||||
|
||||
const int DeleteFiles::kBatchSize = 50;
|
||||
|
||||
DeleteFiles::DeleteFiles(TaskManager* task_manager,
|
||||
boost::shared_ptr<MusicStorage> storage)
|
||||
std::shared_ptr<MusicStorage> storage)
|
||||
: thread_(NULL),
|
||||
task_manager_(task_manager),
|
||||
storage_(storage),
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef DELETEFILES_H
|
||||
#define DELETEFILES_H
|
||||
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <QObject>
|
||||
|
||||
#include "song.h"
|
||||
|
||||
@ -31,7 +31,7 @@ class DeleteFiles : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DeleteFiles(TaskManager* task_manager, boost::shared_ptr<MusicStorage> storage);
|
||||
DeleteFiles(TaskManager* task_manager, std::shared_ptr<MusicStorage> storage);
|
||||
~DeleteFiles();
|
||||
|
||||
static const int kBatchSize;
|
||||
@ -49,7 +49,7 @@ private:
|
||||
QThread* thread_;
|
||||
QThread* original_thread_;
|
||||
TaskManager* task_manager_;
|
||||
boost::shared_ptr<MusicStorage> storage_;
|
||||
std::shared_ptr<MusicStorage> storage_;
|
||||
|
||||
SongList songs_;
|
||||
|
||||
|
@ -18,13 +18,13 @@
|
||||
#ifndef MACGLOBALSHORTCUTBACKEND_H
|
||||
#define MACGLOBALSHORTCUTBACKEND_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "globalshortcutbackend.h"
|
||||
|
||||
#include <QKeySequence>
|
||||
#include <QMap>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class MacGlobalShortcutBackendPrivate;
|
||||
class QAction;
|
||||
|
||||
@ -50,7 +50,7 @@ private:
|
||||
QMap<QKeySequence, QAction*> shortcuts_;
|
||||
|
||||
friend class MacGlobalShortcutBackendPrivate;
|
||||
boost::scoped_ptr<MacGlobalShortcutBackendPrivate> p_;
|
||||
std::unique_ptr<MacGlobalShortcutBackendPrivate> p_;
|
||||
};
|
||||
|
||||
#endif // MACGLOBALSHORTCUTBACKEND_H
|
||||
|
@ -20,6 +20,9 @@
|
||||
|
||||
#include <QAbstractProxyModel>
|
||||
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
#include <boost/multi_index_container.hpp>
|
||||
#include <boost/multi_index/member.hpp>
|
||||
#include <boost/multi_index/ordered_index.hpp>
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <QObject>
|
||||
#include <QtDBus>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class Application;
|
||||
class MainWindow;
|
||||
class Playlist;
|
||||
|
@ -20,10 +20,10 @@
|
||||
|
||||
#include "song.h"
|
||||
|
||||
#include <QMetaType>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <QMetaType>
|
||||
|
||||
class MusicStorage {
|
||||
public:
|
||||
@ -44,7 +44,7 @@ public:
|
||||
Transcode_Unsupported = 3,
|
||||
};
|
||||
|
||||
typedef boost::function<void (float progress)> ProgressFunction;
|
||||
typedef std::function<void (float progress)> ProgressFunction;
|
||||
|
||||
struct CopyJob {
|
||||
QString source_;
|
||||
@ -77,6 +77,6 @@ public:
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(MusicStorage*);
|
||||
Q_DECLARE_METATYPE(boost::shared_ptr<MusicStorage>);
|
||||
Q_DECLARE_METATYPE(std::shared_ptr<MusicStorage>);
|
||||
|
||||
#endif // MUSICSTORAGE_H
|
||||
|
@ -15,12 +15,9 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "musicstorage.h"
|
||||
#include "organise.h"
|
||||
#include "taskmanager.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/tagreaderclient.h"
|
||||
#include "core/utilities.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
@ -28,13 +25,19 @@
|
||||
#include <QThread>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include "musicstorage.h"
|
||||
#include "taskmanager.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/tagreaderclient.h"
|
||||
#include "core/utilities.h"
|
||||
|
||||
using std::placeholders::_1;
|
||||
|
||||
const int Organise::kBatchSize = 10;
|
||||
const int Organise::kTranscodeProgressInterval = 500;
|
||||
|
||||
Organise::Organise(TaskManager* task_manager,
|
||||
boost::shared_ptr<MusicStorage> destination,
|
||||
std::shared_ptr<MusicStorage> destination,
|
||||
const OrganiseFormat &format, bool copy, bool overwrite,
|
||||
const NewSongInfoList& songs_info, bool eject_after)
|
||||
: thread_(NULL),
|
||||
@ -177,8 +180,8 @@ void Organise::ProcessSomeFiles() {
|
||||
job.metadata_ = song;
|
||||
job.overwrite_ = overwrite_;
|
||||
job.remove_original_ = !copy_;
|
||||
job.progress_ = boost::bind(&Organise::SetSongProgress,
|
||||
this, _1, !task.transcoded_filename_.isEmpty());
|
||||
job.progress_ = std::bind(&Organise::SetSongProgress,
|
||||
this, _1, !task.transcoded_filename_.isEmpty());
|
||||
|
||||
if (!destination_->CopyToStorage(job)) {
|
||||
files_with_errors_ << task.song_info_.song_.basefilename();
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef ORGANISE_H
|
||||
#define ORGANISE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QBasicTimer>
|
||||
#include <QObject>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "organiseformat.h"
|
||||
#include "transcoder/transcoder.h"
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
typedef QList<NewSongInfo> NewSongInfoList;
|
||||
|
||||
Organise(TaskManager* task_manager,
|
||||
boost::shared_ptr<MusicStorage> destination,
|
||||
std::shared_ptr<MusicStorage> destination,
|
||||
const OrganiseFormat& format, bool copy, bool overwrite,
|
||||
const NewSongInfoList& songs, bool eject_after);
|
||||
|
||||
@ -85,7 +85,7 @@ private:
|
||||
QThread* original_thread_;
|
||||
TaskManager* task_manager_;
|
||||
Transcoder* transcoder_;
|
||||
boost::shared_ptr<MusicStorage> destination_;
|
||||
std::shared_ptr<MusicStorage> destination_;
|
||||
QList<Song::FileType> supported_filetypes_;
|
||||
|
||||
const OrganiseFormat format_;
|
||||
|
@ -15,8 +15,15 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "player.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QtDebug>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include "config.h"
|
||||
#include "core/application.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/urlhandler.h"
|
||||
@ -31,13 +38,7 @@
|
||||
# include "internet/lastfmservice.h"
|
||||
#endif
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
||||
using std::shared_ptr;
|
||||
|
||||
Player::Player(Application* app, QObject* parent)
|
||||
: PlayerInterface(parent),
|
||||
|
@ -18,11 +18,11 @@
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
#include <QSettings>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "config.h"
|
||||
#include "core/song.h"
|
||||
#include "core/urlhandler.h"
|
||||
@ -176,7 +176,7 @@ public slots:
|
||||
|
||||
PlaylistItemPtr current_item_;
|
||||
|
||||
boost::scoped_ptr<EngineBase> engine_;
|
||||
std::unique_ptr<EngineBase> engine_;
|
||||
Engine::TrackChangeFlags stream_change_type_;
|
||||
Engine::State last_state_;
|
||||
int nb_errors_received_;
|
||||
|
@ -17,7 +17,8 @@
|
||||
|
||||
#include "songloader.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QDirIterator>
|
||||
@ -49,6 +50,7 @@
|
||||
#include "podcasts/podcastservice.h"
|
||||
#include "podcasts/podcasturlloader.h"
|
||||
|
||||
using std::placeholders::_1;
|
||||
|
||||
QSet<QString> SongLoader::sRawUriSchemes;
|
||||
const int SongLoader::kDefaultTimeout = 5000;
|
||||
@ -234,7 +236,7 @@ SongLoader::Result SongLoader::LoadLocal(const QString& filename) {
|
||||
// inside right away.
|
||||
if (QFileInfo(filename).isDir()) {
|
||||
ConcurrentRun::Run<void>(&thread_pool_,
|
||||
boost::bind(&SongLoader::LoadLocalDirectoryAndEmit, this, filename));
|
||||
std::bind(&SongLoader::LoadLocalDirectoryAndEmit, this, filename));
|
||||
return WillLoadAsync;
|
||||
}
|
||||
|
||||
@ -257,7 +259,7 @@ SongLoader::Result SongLoader::LoadLocal(const QString& filename) {
|
||||
|
||||
// It's a playlist!
|
||||
ConcurrentRun::Run<void>(&thread_pool_,
|
||||
boost::bind(&SongLoader::LoadPlaylistAndEmit, this, parser, filename));
|
||||
std::bind(&SongLoader::LoadPlaylistAndEmit, this, parser, filename));
|
||||
return WillLoadAsync;
|
||||
}
|
||||
|
||||
@ -460,8 +462,8 @@ SongLoader::Result SongLoader::LoadRemote() {
|
||||
// rest of the file, parse the playlist and return success.
|
||||
|
||||
// Create the pipeline - it gets unreffed if it goes out of scope
|
||||
boost::shared_ptr<GstElement> pipeline(
|
||||
gst_pipeline_new(NULL), boost::bind(&gst_object_unref, _1));
|
||||
std::shared_ptr<GstElement> pipeline(
|
||||
gst_pipeline_new(NULL), std::bind(&gst_object_unref, _1));
|
||||
|
||||
// Create the source element automatically based on the URL
|
||||
GstElement* source = gst_element_make_from_uri(
|
||||
|
@ -18,6 +18,10 @@
|
||||
#ifndef SONGLOADER_H
|
||||
#define SONGLOADER_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QThreadPool>
|
||||
#include <QUrl>
|
||||
@ -26,10 +30,6 @@
|
||||
#include "core/tagreaderclient.h"
|
||||
#include "musicbrainz/musicbrainzclient.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
class CueParser;
|
||||
class LibraryBackendInterface;
|
||||
class ParserBase;
|
||||
@ -134,7 +134,7 @@ private:
|
||||
LibraryBackendInterface* library_;
|
||||
const Player* player_;
|
||||
|
||||
boost::shared_ptr<GstElement> pipeline_;
|
||||
std::shared_ptr<GstElement> pipeline_;
|
||||
|
||||
QThreadPool thread_pool_;
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
@ -267,7 +267,7 @@ bool Copy(QIODevice* source, QIODevice* destination) {
|
||||
return false;
|
||||
|
||||
const qint64 bytes = source->size();
|
||||
boost::scoped_array<char> data(new char[bytes]);
|
||||
std::unique_ptr<char[]> data(new char[bytes]);
|
||||
qint64 pos = 0;
|
||||
|
||||
qint64 bytes_read;
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef UTILITIES_H
|
||||
#define UTILITIES_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QColor>
|
||||
#include <QFile>
|
||||
#include <QLocale>
|
||||
@ -26,8 +28,6 @@
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
class QIODevice;
|
||||
class QMouseEvent;
|
||||
class QXmlStreamReader;
|
||||
@ -171,7 +171,7 @@ private:
|
||||
Q_DISABLE_COPY(ScopedWCharArray);
|
||||
|
||||
int chars_;
|
||||
boost::scoped_array<wchar_t> data_;
|
||||
std::unique_ptr<wchar_t[]> data_;
|
||||
};
|
||||
|
||||
#endif // UTILITIES_H
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include <QQueue>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class QNetworkReply;
|
||||
class QString;
|
||||
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef CURRENTARTLOADER_H
|
||||
#define CURRENTARTLOADER_H
|
||||
|
||||
#include "core/song.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "core/song.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
|
||||
class Application;
|
||||
|
||||
@ -56,8 +56,8 @@ private:
|
||||
|
||||
QString temp_file_pattern_;
|
||||
|
||||
boost::scoped_ptr<QTemporaryFile> temp_art_;
|
||||
boost::scoped_ptr<QTemporaryFile> temp_art_thumbnail_;
|
||||
std::unique_ptr<QTemporaryFile> temp_art_;
|
||||
std::unique_ptr<QTemporaryFile> temp_art_thumbnail_;
|
||||
quint64 id_;
|
||||
|
||||
Song last_song_;
|
||||
|
@ -18,14 +18,14 @@
|
||||
#ifndef CONNECTEDDEVICE_H
|
||||
#define CONNECTEDDEVICE_H
|
||||
|
||||
#include "core/musicstorage.h"
|
||||
#include "core/song.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include "core/musicstorage.h"
|
||||
#include "core/song.h"
|
||||
|
||||
class Application;
|
||||
class Database;
|
||||
@ -35,7 +35,7 @@ class LibraryBackend;
|
||||
class LibraryModel;
|
||||
|
||||
class ConnectedDevice : public QObject, public virtual MusicStorage,
|
||||
public boost::enable_shared_from_this<ConnectedDevice> {
|
||||
public std::enable_shared_from_this<ConnectedDevice> {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef DEVICEKITLISTER_H
|
||||
#define DEVICEKITLISTER_H
|
||||
|
||||
#include "devicelister.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QStringList>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "devicelister.h"
|
||||
|
||||
class OrgFreedesktopUDisksInterface;
|
||||
|
||||
@ -88,7 +88,7 @@ private:
|
||||
T LockAndGetDeviceInfo(const QString& id, T DeviceData::*field);
|
||||
|
||||
private:
|
||||
boost::scoped_ptr<OrgFreedesktopUDisksInterface> interface_;
|
||||
std::unique_ptr<OrgFreedesktopUDisksInterface> interface_;
|
||||
|
||||
QMutex mutex_;
|
||||
QMap<QString, DeviceData> device_data_;
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <QAbstractItemModel>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class ConnectedDevice;
|
||||
class DeviceManager;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "devicemanager.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
@ -60,7 +60,7 @@
|
||||
# include "mtpdevice.h"
|
||||
#endif
|
||||
|
||||
using boost::bind;
|
||||
using std::bind;
|
||||
|
||||
const int DeviceManager::kDeviceIconSize = 32;
|
||||
const int DeviceManager::kDeviceIconOverlaySize = 16;
|
||||
@ -311,7 +311,7 @@ QVariant DeviceManager::data(const QModelIndex& index, int role) const {
|
||||
const_cast<DeviceManager*>(this)->Connect(index.row());
|
||||
if (!info.device_)
|
||||
return QVariant();
|
||||
return QVariant::fromValue<boost::shared_ptr<MusicStorage> >(info.device_);
|
||||
return QVariant::fromValue<std::shared_ptr<MusicStorage>>(info.device_);
|
||||
|
||||
case MusicStorage::Role_StorageForceConnect:
|
||||
if (!info.device_) {
|
||||
@ -319,7 +319,7 @@ QVariant DeviceManager::data(const QModelIndex& index, int role) const {
|
||||
!info.BestBackend()->lister_->DeviceNeedsMount(info.BestBackend()->unique_id_)) {
|
||||
|
||||
if (info.BestBackend()->lister_->AskForScan(info.BestBackend()->unique_id_)) {
|
||||
boost::scoped_ptr<QMessageBox> dialog(new QMessageBox(
|
||||
std::unique_ptr<QMessageBox> dialog(new QMessageBox(
|
||||
QMessageBox::Information, tr("Connect device"),
|
||||
tr("This is the first time you have connected this device. Clementine will now scan the device to find music files - this may take some time."),
|
||||
QMessageBox::Cancel));
|
||||
@ -336,7 +336,7 @@ QVariant DeviceManager::data(const QModelIndex& index, int role) const {
|
||||
}
|
||||
if (!info.device_)
|
||||
return QVariant();
|
||||
return QVariant::fromValue<boost::shared_ptr<MusicStorage> >(info.device_);
|
||||
return QVariant::fromValue<std::shared_ptr<MusicStorage>>(info.device_);
|
||||
|
||||
case Role_MountPath: {
|
||||
if (!info.device_)
|
||||
@ -520,12 +520,12 @@ void DeviceManager::PhysicalDeviceChanged(const QString &id) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
boost::shared_ptr<ConnectedDevice> DeviceManager::Connect(int row) {
|
||||
std::shared_ptr<ConnectedDevice> DeviceManager::Connect(int row) {
|
||||
DeviceInfo& info = devices_[row];
|
||||
if (info.device_) // Already connected
|
||||
return info.device_;
|
||||
|
||||
boost::shared_ptr<ConnectedDevice> ret;
|
||||
std::shared_ptr<ConnectedDevice> ret;
|
||||
|
||||
if (!info.BestBackend()->lister_) // Not physically connected
|
||||
return ret;
|
||||
@ -612,7 +612,7 @@ boost::shared_ptr<ConnectedDevice> DeviceManager::Connect(int row) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ConnectedDevice> DeviceManager::GetConnectedDevice(int row) const {
|
||||
std::shared_ptr<ConnectedDevice> DeviceManager::GetConnectedDevice(int row) const {
|
||||
return devices_[row].device_;
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,14 @@
|
||||
#define DEVICEMANAGER_H
|
||||
|
||||
#include "devicedatabasebackend.h"
|
||||
#include "library/librarymodel.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QIcon>
|
||||
#include <QThreadPool>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "library/librarymodel.h"
|
||||
|
||||
class Application;
|
||||
class ConnectedDevice;
|
||||
@ -72,13 +73,13 @@ public:
|
||||
// Get info about devices
|
||||
int GetDatabaseId(int row) const;
|
||||
DeviceLister* GetLister(int row) const;
|
||||
boost::shared_ptr<ConnectedDevice> GetConnectedDevice(int row) const;
|
||||
std::shared_ptr<ConnectedDevice> GetConnectedDevice(int row) const;
|
||||
|
||||
int FindDeviceById(const QString& id) const;
|
||||
int FindDeviceByUrl(const QList<QUrl>& url) const;
|
||||
|
||||
// Actions on devices
|
||||
boost::shared_ptr<ConnectedDevice> Connect(int row);
|
||||
std::shared_ptr<ConnectedDevice> Connect(int row);
|
||||
void Disconnect(int row);
|
||||
void Forget(int row);
|
||||
void UnmountAsync(int row);
|
||||
@ -143,7 +144,7 @@ private:
|
||||
|
||||
|
||||
int database_id_; // -1 if not remembered in the database
|
||||
boost::shared_ptr<ConnectedDevice> device_; // NULL if not connected to clementine
|
||||
std::shared_ptr<ConnectedDevice> device_; // NULL if not connected to clementine
|
||||
QList<Backend> backends_;
|
||||
|
||||
QString friendly_name_;
|
||||
|
@ -15,20 +15,22 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "connecteddevice.h"
|
||||
#include "devicelister.h"
|
||||
#include "devicemanager.h"
|
||||
#include "deviceproperties.h"
|
||||
#include "ui_deviceproperties.h"
|
||||
#include "core/utilities.h"
|
||||
#include "transcoder/transcoder.h"
|
||||
#include "ui/iconloader.h"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#include <QScrollBar>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include "connecteddevice.h"
|
||||
#include "devicelister.h"
|
||||
#include "devicemanager.h"
|
||||
#include "ui_deviceproperties.h"
|
||||
#include "core/utilities.h"
|
||||
#include "transcoder/transcoder.h"
|
||||
#include "ui/iconloader.h"
|
||||
|
||||
DeviceProperties::DeviceProperties(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
@ -178,7 +180,7 @@ void DeviceProperties::UpdateHardwareInfo() {
|
||||
void DeviceProperties::UpdateFormats() {
|
||||
QString id = index_.data(DeviceManager::Role_UniqueId).toString();
|
||||
DeviceLister* lister = manager_->GetLister(index_.row());
|
||||
boost::shared_ptr<ConnectedDevice> device =
|
||||
std::shared_ptr<ConnectedDevice> device =
|
||||
manager_->GetConnectedDevice(index_.row());
|
||||
|
||||
// Transcode mode
|
||||
@ -219,7 +221,7 @@ void DeviceProperties::UpdateFormats() {
|
||||
// blocks, so do it in the background.
|
||||
supported_formats_.clear();
|
||||
|
||||
QFuture<bool> future = QtConcurrent::run(boost::bind(
|
||||
QFuture<bool> future = QtConcurrent::run(std::bind(
|
||||
&ConnectedDevice::GetSupportedFiletypes, device, &supported_formats_));
|
||||
QFutureWatcher<bool>* watcher = new QFutureWatcher<bool>(this);
|
||||
watcher->setFuture(future);
|
||||
|
@ -15,11 +15,22 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "deviceview.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "connecteddevice.h"
|
||||
#include "devicelister.h"
|
||||
#include "devicemanager.h"
|
||||
#include "deviceproperties.h"
|
||||
#include "deviceview.h"
|
||||
#include "core/application.h"
|
||||
#include "core/deletefiles.h"
|
||||
#include "core/mergedproxymodel.h"
|
||||
@ -31,16 +42,6 @@
|
||||
#include "ui/organisedialog.h"
|
||||
#include "ui/organiseerrordialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
const int DeviceItemDelegate::kIconPadding = 6;
|
||||
|
||||
DeviceItemDelegate::DeviceItemDelegate(QObject *parent)
|
||||
@ -238,7 +239,8 @@ void DeviceView::contextMenuEvent(QContextMenuEvent* e) {
|
||||
|
||||
bool is_filesystem_device = false;
|
||||
if (parent_device_index.isValid()) {
|
||||
boost::shared_ptr<ConnectedDevice> device = app_->device_manager()->GetConnectedDevice(parent_device_index.row());
|
||||
std::shared_ptr<ConnectedDevice> device =
|
||||
app_->device_manager()->GetConnectedDevice(parent_device_index.row());
|
||||
if (device && !device->LocalPath().isEmpty())
|
||||
is_filesystem_device = true;
|
||||
}
|
||||
@ -281,7 +283,8 @@ void DeviceView::Connect() {
|
||||
}
|
||||
|
||||
void DeviceView::DeviceConnected(int row) {
|
||||
boost::shared_ptr<ConnectedDevice> device = app_->device_manager()->GetConnectedDevice(row);
|
||||
std::shared_ptr<ConnectedDevice> device =
|
||||
app_->device_manager()->GetConnectedDevice(row);
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
@ -306,7 +309,7 @@ void DeviceView::Forget() {
|
||||
QString unique_id = app_->device_manager()->data(device_idx, DeviceManager::Role_UniqueId).toString();
|
||||
if (app_->device_manager()->GetLister(device_idx.row()) &&
|
||||
app_->device_manager()->GetLister(device_idx.row())->AskForScan(unique_id)) {
|
||||
boost::scoped_ptr<QMessageBox> dialog(new QMessageBox(
|
||||
std::unique_ptr<QMessageBox> dialog(new QMessageBox(
|
||||
QMessageBox::Question, tr("Forget device"),
|
||||
tr("Forgetting a device will remove it from this list and Clementine will have to rescan all the songs again next time you connect it."),
|
||||
QMessageBox::Cancel, this));
|
||||
@ -390,8 +393,8 @@ void DeviceView::Delete() {
|
||||
QMessageBox::Yes, QMessageBox::Cancel) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
boost::shared_ptr<MusicStorage> storage =
|
||||
device_index.data(MusicStorage::Role_Storage).value<boost::shared_ptr<MusicStorage> >();
|
||||
std::shared_ptr<MusicStorage> storage =
|
||||
device_index.data(MusicStorage::Role_Storage).value<std::shared_ptr<MusicStorage>>();
|
||||
|
||||
DeleteFiles* delete_files = new DeleteFiles(app_->task_manager(), storage);
|
||||
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef DEVICEVIEW_H
|
||||
#define DEVICEVIEW_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/song.h"
|
||||
#include "library/libraryview.h"
|
||||
#include "widgets/autoexpandingtreeview.h"
|
||||
@ -88,8 +90,8 @@ private:
|
||||
MergedProxyModel* merged_model_;
|
||||
QSortFilterProxyModel* sort_model_;
|
||||
|
||||
boost::scoped_ptr<DeviceProperties> properties_dialog_;
|
||||
boost::scoped_ptr<OrganiseDialog> organise_dialog_;
|
||||
std::unique_ptr<DeviceProperties> properties_dialog_;
|
||||
std::unique_ptr<OrganiseDialog> organise_dialog_;
|
||||
|
||||
QMenu* device_menu_;
|
||||
QAction* eject_action_;
|
||||
|
@ -17,16 +17,20 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include "giolister.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/signalchecker.h"
|
||||
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
using std::placeholders::_3;
|
||||
|
||||
QString GioLister::DeviceInfo::unique_id() const {
|
||||
if (mount)
|
||||
return QString("Gio/%1/%2/%3").arg(mount_uuid, filesystem_type).arg(filesystem_size);
|
||||
@ -65,7 +69,7 @@ void OperationFinished(F f, GObject *object, GAsyncResult *result) {
|
||||
}
|
||||
|
||||
void GioLister::VolumeMountFinished(GObject* object, GAsyncResult* result, gpointer) {
|
||||
OperationFinished<GVolume>(boost::bind(
|
||||
OperationFinished<GVolume>(std::bind(
|
||||
g_volume_mount_finish, _1, _2, _3), object, result);
|
||||
}
|
||||
|
||||
@ -456,17 +460,17 @@ QString GioLister::FindUniqueIdByVolume(GVolume* volume) const {
|
||||
}
|
||||
|
||||
void GioLister::VolumeEjectFinished(GObject *object, GAsyncResult *result, gpointer) {
|
||||
OperationFinished<GVolume>(boost::bind(
|
||||
OperationFinished<GVolume>(std::bind(
|
||||
g_volume_eject_with_operation_finish, _1, _2, _3), object, result);
|
||||
}
|
||||
|
||||
void GioLister::MountEjectFinished(GObject *object, GAsyncResult *result, gpointer) {
|
||||
OperationFinished<GMount>(boost::bind(
|
||||
OperationFinished<GMount>(std::bind(
|
||||
g_mount_eject_with_operation_finish, _1, _2, _3), object, result);
|
||||
}
|
||||
|
||||
void GioLister::MountUnmountFinished(GObject *object, GAsyncResult *result, gpointer) {
|
||||
OperationFinished<GMount>(boost::bind(
|
||||
OperationFinished<GMount>(std::bind(
|
||||
g_mount_unmount_with_operation_finish, _1, _2, _3), object, result);
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,9 @@
|
||||
#include <QDir>
|
||||
#include <QtDebug>
|
||||
|
||||
GPodLoader::GPodLoader(const QString& mount_point, TaskManager* task_manager,
|
||||
LibraryBackend* backend, boost::shared_ptr<ConnectedDevice> device)
|
||||
GPodLoader::GPodLoader(
|
||||
const QString& mount_point, TaskManager* task_manager,
|
||||
LibraryBackend* backend, std::shared_ptr<ConnectedDevice> device)
|
||||
: QObject(NULL),
|
||||
device_(device),
|
||||
mount_point_(mount_point),
|
||||
|
@ -18,9 +18,10 @@
|
||||
#ifndef GPODLOADER_H
|
||||
#define GPODLOADER_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gpod/itdb.h>
|
||||
|
||||
#include "core/song.h"
|
||||
@ -34,7 +35,7 @@ class GPodLoader : public QObject {
|
||||
|
||||
public:
|
||||
GPodLoader(const QString& mount_point, TaskManager* task_manager,
|
||||
LibraryBackend* backend, boost::shared_ptr<ConnectedDevice> device);
|
||||
LibraryBackend* backend, std::shared_ptr<ConnectedDevice> device);
|
||||
~GPodLoader();
|
||||
|
||||
void set_music_path_prefix(const QString& prefix) { path_prefix_ = prefix; }
|
||||
@ -49,7 +50,7 @@ signals:
|
||||
void LoadFinished(Itdb_iTunesDB* db);
|
||||
|
||||
private:
|
||||
boost::shared_ptr<ConnectedDevice> device_;
|
||||
std::shared_ptr<ConnectedDevice> device_;
|
||||
QThread* original_thread_;
|
||||
|
||||
QString mount_point_;
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef MTPDEVICE_H
|
||||
#define MTPDEVICE_H
|
||||
|
||||
#include "connecteddevice.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "connecteddevice.h"
|
||||
|
||||
struct LIBMTP_mtpdevice_struct;
|
||||
|
||||
@ -74,7 +74,7 @@ private:
|
||||
SongList songs_to_add_;
|
||||
SongList songs_to_remove_;
|
||||
|
||||
boost::scoped_ptr<MtpConnection> connection_;
|
||||
std::unique_ptr<MtpConnection> connection_;
|
||||
};
|
||||
|
||||
#endif // MTPDEVICE_H
|
||||
|
@ -15,17 +15,19 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mtploader.h"
|
||||
|
||||
#include <libmtp.h>
|
||||
|
||||
#include "connecteddevice.h"
|
||||
#include "mtpconnection.h"
|
||||
#include "mtploader.h"
|
||||
#include "core/song.h"
|
||||
#include "core/taskmanager.h"
|
||||
#include "library/librarybackend.h"
|
||||
|
||||
#include <libmtp.h>
|
||||
|
||||
MtpLoader::MtpLoader(const QUrl& url, TaskManager* task_manager,
|
||||
LibraryBackend* backend, boost::shared_ptr<ConnectedDevice> device)
|
||||
MtpLoader::MtpLoader(
|
||||
const QUrl& url, TaskManager* task_manager,
|
||||
LibraryBackend* backend, std::shared_ptr<ConnectedDevice> device)
|
||||
: QObject(NULL),
|
||||
device_(device),
|
||||
url_(url),
|
||||
|
@ -18,11 +18,11 @@
|
||||
#ifndef MTPLOADER_H
|
||||
#define MTPLOADER_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class ConnectedDevice;
|
||||
class LibraryBackend;
|
||||
class TaskManager;
|
||||
@ -32,7 +32,7 @@ class MtpLoader : public QObject {
|
||||
|
||||
public:
|
||||
MtpLoader(const QUrl& url, TaskManager* task_manager,
|
||||
LibraryBackend* backend, boost::shared_ptr<ConnectedDevice> device);
|
||||
LibraryBackend* backend, std::shared_ptr<ConnectedDevice> device);
|
||||
~MtpLoader();
|
||||
|
||||
public slots:
|
||||
@ -47,7 +47,7 @@ private:
|
||||
bool TryLoad();
|
||||
|
||||
private:
|
||||
boost::shared_ptr<ConnectedDevice> device_;
|
||||
std::shared_ptr<ConnectedDevice> device_;
|
||||
QThread* original_thread_;
|
||||
|
||||
QUrl url_;
|
||||
|
@ -27,8 +27,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
@ -39,7 +37,7 @@ namespace Engine {
|
||||
|
||||
typedef std::vector<int16_t> Scope;
|
||||
|
||||
class Base : public QObject, boost::noncopyable {
|
||||
class Base : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -153,6 +151,7 @@ class Base : public QObject, boost::noncopyable {
|
||||
|
||||
private:
|
||||
bool about_to_end_emitted_;
|
||||
Q_DISABLE_COPY(Base);
|
||||
};
|
||||
|
||||
|
||||
|
@ -19,23 +19,14 @@
|
||||
* 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include "gstengine.h"
|
||||
#include "gstenginepipeline.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/taskmanager.h"
|
||||
#include "core/utilities.h"
|
||||
|
||||
#ifdef HAVE_MOODBAR
|
||||
# include "gst/moodbar/spectrum.h"
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QRegExp>
|
||||
@ -48,9 +39,18 @@
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "gstenginepipeline.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/taskmanager.h"
|
||||
#include "core/utilities.h"
|
||||
|
||||
#ifdef HAVE_MOODBAR
|
||||
# include "gst/moodbar/spectrum.h"
|
||||
#endif
|
||||
|
||||
using std::shared_ptr;
|
||||
using std::vector;
|
||||
using boost::shared_ptr;
|
||||
|
||||
const char* GstEngine::kSettingsGroup = "GstEngine";
|
||||
const char* GstEngine::kAutoSink = "autoaudiosink";
|
||||
|
@ -22,6 +22,8 @@
|
||||
#ifndef AMAROK_GSTENGINE_H
|
||||
#define AMAROK_GSTENGINE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "bufferconsumer.h"
|
||||
#include "enginebase.h"
|
||||
#include "core/boundfuturewatcher.h"
|
||||
@ -35,7 +37,6 @@
|
||||
#include <QTimerEvent>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class QTimer;
|
||||
class QTimerEvent;
|
||||
@ -146,12 +147,13 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||
void StartTimers();
|
||||
void StopTimers();
|
||||
|
||||
boost::shared_ptr<GstEnginePipeline> CreatePipeline();
|
||||
boost::shared_ptr<GstEnginePipeline> CreatePipeline(const QUrl& url, qint64 end_nanosec);
|
||||
std::shared_ptr<GstEnginePipeline> CreatePipeline();
|
||||
std::shared_ptr<GstEnginePipeline> CreatePipeline(
|
||||
const QUrl& url, qint64 end_nanosec);
|
||||
|
||||
void UpdateScope();
|
||||
|
||||
int AddBackgroundStream(boost::shared_ptr<GstEnginePipeline> pipeline);
|
||||
int AddBackgroundStream(std::shared_ptr<GstEnginePipeline> pipeline);
|
||||
|
||||
static QUrl FixupUrl(const QUrl& url);
|
||||
|
||||
@ -171,9 +173,9 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||
QString sink_;
|
||||
QString device_;
|
||||
|
||||
boost::shared_ptr<GstEnginePipeline> current_pipeline_;
|
||||
boost::shared_ptr<GstEnginePipeline> fadeout_pipeline_;
|
||||
boost::shared_ptr<GstEnginePipeline> fadeout_pause_pipeline_;
|
||||
std::shared_ptr<GstEnginePipeline> current_pipeline_;
|
||||
std::shared_ptr<GstEnginePipeline> fadeout_pipeline_;
|
||||
std::shared_ptr<GstEnginePipeline> fadeout_pause_pipeline_;
|
||||
QUrl preloaded_url_;
|
||||
|
||||
QList<BufferConsumer*> buffer_consumers_;
|
||||
@ -205,7 +207,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||
int timer_id_;
|
||||
int next_element_id_;
|
||||
|
||||
QHash<int, boost::shared_ptr<GstEnginePipeline> > background_streams_;
|
||||
QHash<int, std::shared_ptr<GstEnginePipeline> > background_streams_;
|
||||
|
||||
bool is_fading_out_to_pause_;
|
||||
bool has_faded_out_;
|
||||
|
@ -41,11 +41,11 @@ const int GstEnginePipeline::kEqBandFrequencies[] = {
|
||||
60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000};
|
||||
|
||||
int GstEnginePipeline::sId = 1;
|
||||
GstElementDeleter* GstEnginePipeline::sElementDeleter = NULL;
|
||||
GstElementDeleter* GstEnginePipeline::sElementDeleter = nullptr;
|
||||
|
||||
|
||||
GstEnginePipeline::GstEnginePipeline(GstEngine* engine)
|
||||
: QObject(NULL),
|
||||
: QObject(nullptr),
|
||||
engine_(engine),
|
||||
id_(sId++),
|
||||
valid_(false),
|
||||
@ -75,20 +75,19 @@ GstEnginePipeline::GstEnginePipeline(GstEngine* engine)
|
||||
pending_seek_nanosec_(-1),
|
||||
volume_percent_(100),
|
||||
volume_modifier_(1.0),
|
||||
fader_(NULL),
|
||||
pipeline_(NULL),
|
||||
uridecodebin_(NULL),
|
||||
audiobin_(NULL),
|
||||
queue_(NULL),
|
||||
audioconvert_(NULL),
|
||||
rgvolume_(NULL),
|
||||
rglimiter_(NULL),
|
||||
audioconvert2_(NULL),
|
||||
equalizer_(NULL),
|
||||
stereo_panorama_(NULL),
|
||||
volume_(NULL),
|
||||
audioscale_(NULL),
|
||||
audiosink_(NULL)
|
||||
pipeline_(nullptr),
|
||||
uridecodebin_(nullptr),
|
||||
audiobin_(nullptr),
|
||||
queue_(nullptr),
|
||||
audioconvert_(nullptr),
|
||||
rgvolume_(nullptr),
|
||||
rglimiter_(nullptr),
|
||||
audioconvert2_(nullptr),
|
||||
equalizer_(nullptr),
|
||||
stereo_panorama_(nullptr),
|
||||
volume_(nullptr),
|
||||
audioscale_(nullptr),
|
||||
audiosink_(nullptr)
|
||||
{
|
||||
if (!sElementDeleter) {
|
||||
sElementDeleter = new GstElementDeleter;
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef GSTENGINEPIPELINE_H
|
||||
#define GSTENGINEPIPELINE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QBasicTimer>
|
||||
#include <QFuture>
|
||||
#include <QMutex>
|
||||
@ -27,7 +29,6 @@
|
||||
#include <QUrl>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "engine_fwd.h"
|
||||
|
||||
@ -253,7 +254,7 @@ class GstEnginePipeline : public QObject {
|
||||
int volume_percent_;
|
||||
qreal volume_modifier_;
|
||||
|
||||
boost::scoped_ptr<QTimeLine> fader_;
|
||||
std::unique_ptr<QTimeLine> fader_;
|
||||
QBasicTimer fader_fudge_timer_;
|
||||
bool use_fudge_timer_;
|
||||
|
||||
|
@ -1,25 +1,33 @@
|
||||
/* This file is part of Clementine.
|
||||
Copyright 2012, David Sansome <me@davidsansome.com>
|
||||
|
||||
|
||||
Clementine is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
Clementine is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "globalsearchview.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStandardItem>
|
||||
#include <QTimer>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "globalsearch.h"
|
||||
#include "globalsearchitemdelegate.h"
|
||||
#include "globalsearchmodel.h"
|
||||
#include "globalsearchsortmodel.h"
|
||||
#include "globalsearchview.h"
|
||||
#include "searchprovider.h"
|
||||
#include "searchproviderstatuswidget.h"
|
||||
#include "suggestionwidget.h"
|
||||
@ -32,12 +40,8 @@
|
||||
#include "library/librarymodel.h"
|
||||
#include "library/groupbydialog.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include <QMenu>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStandardItem>
|
||||
#include <QTimer>
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
const int GlobalSearchView::kSwapModelsTimeoutMsec = 250;
|
||||
const int GlobalSearchView::kMaxSuggestions = 10;
|
||||
@ -176,14 +180,14 @@ namespace {
|
||||
|
||||
void GlobalSearchView::ReloadSettings() {
|
||||
QSettings s;
|
||||
|
||||
|
||||
// Library settings
|
||||
s.beginGroup(LibraryView::kSettingsGroup);
|
||||
const bool pretty = s.value("pretty_covers", true).toBool();
|
||||
front_model_->set_use_pretty_covers(pretty);
|
||||
back_model_->set_use_pretty_covers(pretty);
|
||||
s.endGroup();
|
||||
|
||||
|
||||
// Global search settings
|
||||
s.beginGroup(GlobalSearch::kSettingsGroup);
|
||||
const QStringList provider_order =
|
||||
@ -197,11 +201,11 @@ void GlobalSearchView::ReloadSettings() {
|
||||
LibraryModel::GroupBy(s.value("group_by2", int(LibraryModel::GroupBy_Album)).toInt()),
|
||||
LibraryModel::GroupBy(s.value("group_by3", int(LibraryModel::GroupBy_None)).toInt())));
|
||||
s.endGroup();
|
||||
|
||||
|
||||
// Delete any old status widgets
|
||||
qDeleteAll(provider_status_widgets_);
|
||||
provider_status_widgets_.clear();
|
||||
|
||||
|
||||
// Toggle visibility of the providers group
|
||||
ui_->providers_group->setVisible(show_providers_);
|
||||
|
||||
@ -209,27 +213,27 @@ void GlobalSearchView::ReloadSettings() {
|
||||
// Sort the list of providers
|
||||
QList<SearchProvider*> providers = engine_->providers();
|
||||
qSort(providers.begin(), providers.end(),
|
||||
boost::bind(&CompareProvider, boost::cref(provider_order), _1, _2));
|
||||
|
||||
std::bind(&CompareProvider, std::cref(provider_order), _1, _2));
|
||||
|
||||
bool any_disabled = false;
|
||||
|
||||
|
||||
foreach (SearchProvider* provider, providers) {
|
||||
QWidget* parent = ui_->enabled_list;
|
||||
if (!engine_->is_provider_usable(provider)) {
|
||||
parent = ui_->disabled_list;
|
||||
any_disabled = true;
|
||||
}
|
||||
|
||||
|
||||
SearchProviderStatusWidget* widget =
|
||||
new SearchProviderStatusWidget(warning_icon_, engine_, provider);
|
||||
|
||||
|
||||
parent->layout()->addWidget(widget);
|
||||
provider_status_widgets_ << widget;
|
||||
}
|
||||
|
||||
|
||||
ui_->disabled_label->setVisible(any_disabled);
|
||||
}
|
||||
|
||||
|
||||
ui_->suggestions_group->setVisible(show_suggestions_);
|
||||
if (!show_suggestions_) {
|
||||
update_suggestions_timer_->stop();
|
||||
|
@ -18,9 +18,7 @@
|
||||
#include "spotifysearchprovider.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
#include <random>
|
||||
|
||||
#include "core/logging.h"
|
||||
#include "internet/internetmodel.h"
|
||||
@ -219,8 +217,8 @@ QStringList SpotifySearchProvider::GetSuggestions(int count) {
|
||||
|
||||
QStringList all_suggestions = suggestions_.toList();
|
||||
|
||||
boost::mt19937 gen(std::time(0));
|
||||
boost::uniform_int<> random(0, all_suggestions.size() - 1);
|
||||
std::mt19937 gen(std::time(0));
|
||||
std::uniform_int_distribution<> random(0, all_suggestions.size() - 1);
|
||||
|
||||
QSet<QString> candidates;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef DIGITALLYIMPORTEDSERVICEBASE_H
|
||||
#define DIGITALLYIMPORTEDSERVICEBASE_H
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "digitallyimportedclient.h"
|
||||
#include "internetservice.h"
|
||||
@ -104,7 +104,7 @@ private:
|
||||
|
||||
QStandardItem* root_;
|
||||
|
||||
boost::scoped_ptr<QMenu> context_menu_;
|
||||
std::unique_ptr<QMenu> context_menu_;
|
||||
QStandardItem* context_item_;
|
||||
|
||||
CachedList<DigitallyImportedClient::Channel> saved_channels_;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "groovesharkservice.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
@ -1286,8 +1286,8 @@ void GroovesharkService::DeletePlaylist(int playlist_id) {
|
||||
if (!playlists_.contains(playlist_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::scoped_ptr<QMessageBox> confirmation_dialog(new QMessageBox(
|
||||
|
||||
std::unique_ptr<QMessageBox> confirmation_dialog(new QMessageBox(
|
||||
QMessageBox::Question, tr("Delete Grooveshark playlist"),
|
||||
tr("Are you sure you want to delete this playlist?"),
|
||||
QMessageBox::Yes | QMessageBox::Cancel));
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
#include "lastfmservice.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <QMenu>
|
||||
#include <QSettings>
|
||||
|
||||
@ -61,7 +59,6 @@
|
||||
#include "ui/iconloader.h"
|
||||
#include "ui/settingsdialog.h"
|
||||
|
||||
using boost::scoped_ptr;
|
||||
using lastfm::XmlQuery;
|
||||
|
||||
uint qHash(const lastfm::Track& track) {
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef LASTFMSERVICE_H
|
||||
#define LASTFMSERVICE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace lastfm {
|
||||
class RadioStation;
|
||||
class Track;
|
||||
@ -40,8 +42,6 @@ uint qHash(const lastfm::Track& track);
|
||||
#include <QMenu>
|
||||
#include <QQueue>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class LastFMUrlHandler;
|
||||
|
||||
class QAction;
|
||||
@ -198,9 +198,9 @@ class LastFMService : public InternetService {
|
||||
QQueue<lastfm::Track> playlist_;
|
||||
bool already_scrobbled_;
|
||||
|
||||
boost::scoped_ptr<LastFMStationDialog> station_dialog_;
|
||||
std::unique_ptr<LastFMStationDialog> station_dialog_;
|
||||
|
||||
boost::scoped_ptr<QMenu> context_menu_;
|
||||
std::unique_ptr<QMenu> context_menu_;
|
||||
QAction* remove_action_;
|
||||
QAction* add_artist_action_;
|
||||
QAction* add_tag_action_;
|
||||
|
@ -16,13 +16,8 @@
|
||||
*/
|
||||
|
||||
#include "magnatunedownloaddialog.h"
|
||||
#include "magnatuneservice.h"
|
||||
#include "internetmodel.h"
|
||||
#include "ui_magnatunedownloaddialog.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/network.h"
|
||||
#include "core/utilities.h"
|
||||
#include "widgets/progressitemdelegate.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QDir>
|
||||
@ -35,6 +30,14 @@
|
||||
#include <QSettings>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "magnatuneservice.h"
|
||||
#include "internetmodel.h"
|
||||
#include "ui_magnatunedownloaddialog.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/network.h"
|
||||
#include "core/utilities.h"
|
||||
#include "widgets/progressitemdelegate.h"
|
||||
|
||||
MagnatuneDownloadDialog::MagnatuneDownloadDialog(MagnatuneService* service,
|
||||
QWidget *parent)
|
||||
: QDialog(parent),
|
||||
@ -275,7 +278,7 @@ QString MagnatuneDownloadDialog::GetOutputFilename() {
|
||||
|
||||
void MagnatuneDownloadDialog::closeEvent(QCloseEvent* e) {
|
||||
if (current_reply_ && current_reply_->isRunning()) {
|
||||
boost::scoped_ptr<QMessageBox> message_box(new QMessageBox(
|
||||
std::unique_ptr<QMessageBox> message_box(new QMessageBox(
|
||||
QMessageBox::Question, tr("Really cancel?"),
|
||||
tr("Closing this window will cancel the download."),
|
||||
QMessageBox::Abort, this));
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef MAGNATUNEDOWNLOADDIALOG_H
|
||||
#define MAGNATUNEDOWNLOADDIALOG_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkReply>
|
||||
#include <QStringList>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "core/song.h"
|
||||
|
||||
class MagnatuneService;
|
||||
@ -71,7 +71,7 @@ private:
|
||||
|
||||
QNetworkAccessManager* network_;
|
||||
QNetworkReply* current_reply_;
|
||||
boost::scoped_ptr<QFile> download_file_;
|
||||
std::unique_ptr<QFile> download_file_;
|
||||
|
||||
int next_row_;
|
||||
};
|
||||
|
@ -51,8 +51,6 @@
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
||||
const char* MagnatuneService::kServiceName = "Magnatune";
|
||||
const char* MagnatuneService::kSettingsGroup = "Magnatune";
|
||||
const char* MagnatuneService::kSongsTable = "magnatune_songs";
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef SAVEDRADIO_H
|
||||
#define SAVEDRADIO_H
|
||||
|
||||
#include "internetservice.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "internetservice.h"
|
||||
|
||||
class QMenu;
|
||||
|
||||
@ -83,7 +83,7 @@ class SavedRadio : public InternetService {
|
||||
|
||||
StreamList streams_;
|
||||
|
||||
boost::scoped_ptr<AddStreamDialog> edit_dialog_;
|
||||
std::unique_ptr<AddStreamDialog> edit_dialog_;
|
||||
};
|
||||
|
||||
#endif // SAVEDRADIO_H
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "skydriveservice.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
using boost::scoped_ptr;
|
||||
#include <memory>
|
||||
|
||||
#include <qjson/parser.h>
|
||||
|
||||
@ -158,7 +157,7 @@ QUrl SkydriveService::GetStreamingUrlFromSongId(const QString& file_id) {
|
||||
QUrl url(QString(kSkydriveBase) + file_id);
|
||||
QNetworkRequest request(url);
|
||||
AddAuthorizationHeader(&request);
|
||||
scoped_ptr<QNetworkReply> reply(network_->get(request));
|
||||
std::unique_ptr<QNetworkReply> reply(network_->get(request));
|
||||
WaitForSignal(reply.get(), SIGNAL(finished()));
|
||||
|
||||
QJson::Parser parser;
|
||||
|
@ -8,8 +8,6 @@
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class Playlist;
|
||||
class SearchBoxWidget;
|
||||
class SpotifyServer;
|
||||
|
@ -20,6 +20,11 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <memory>
|
||||
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
#include <boost/multi_index_container.hpp>
|
||||
#include <boost/multi_index/member.hpp>
|
||||
#include <boost/multi_index/ordered_index.hpp>
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class Application;
|
||||
class Database;
|
||||
class LibraryBackend;
|
||||
|
@ -46,7 +46,7 @@ void LibraryDirectoryModel::DirectoryDiscovered(const Directory &dir) {
|
||||
}
|
||||
item->setData(dir.id, kIdRole);
|
||||
item->setIcon(dir_icon_);
|
||||
storage_ << boost::shared_ptr<MusicStorage>(new FilesystemMusicStorage(dir.path));
|
||||
storage_ << std::shared_ptr<MusicStorage>(new FilesystemMusicStorage(dir.path));
|
||||
appendRow(item);
|
||||
}
|
||||
|
||||
|
@ -18,11 +18,11 @@
|
||||
#ifndef LIBRARYDIRECTORYMODEL_H
|
||||
#define LIBRARYDIRECTORYMODEL_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "directory.h"
|
||||
|
||||
class LibraryBackend;
|
||||
@ -51,7 +51,7 @@ class LibraryDirectoryModel : public QStandardItemModel {
|
||||
|
||||
QIcon dir_icon_;
|
||||
LibraryBackend* backend_;
|
||||
QList<boost::shared_ptr<MusicStorage> > storage_;
|
||||
QList<std::shared_ptr<MusicStorage> > storage_;
|
||||
};
|
||||
|
||||
#endif // LIBRARYDIRECTORYMODEL_H
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef LIBRARYFILTERWIDGET_H
|
||||
#define LIBRARYFILTERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <QWidget>
|
||||
|
||||
#include "librarymodel.h"
|
||||
|
||||
@ -92,7 +92,7 @@ class LibraryFilterWidget : public QWidget {
|
||||
Ui_LibraryFilterWidget* ui_;
|
||||
LibraryModel* model_;
|
||||
|
||||
boost::scoped_ptr<GroupByDialog> group_by_dialog_;
|
||||
std::unique_ptr<GroupByDialog> group_by_dialog_;
|
||||
SettingsDialog* settings_dialog_;
|
||||
|
||||
QMenu* filter_age_menu_;
|
||||
|
@ -16,6 +16,18 @@
|
||||
*/
|
||||
|
||||
#include "librarymodel.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
#include <QMetaEnum>
|
||||
#include <QPixmapCache>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include "librarybackend.h"
|
||||
#include "libraryitem.h"
|
||||
#include "librarydirectorymodel.h"
|
||||
@ -32,16 +44,8 @@
|
||||
#include "smartplaylists/querygenerator.h"
|
||||
#include "ui/iconloader.h"
|
||||
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
#include <QMetaEnum>
|
||||
#include <QPixmapCache>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
|
||||
using smart_playlists::Generator;
|
||||
using smart_playlists::GeneratorMimeData;
|
||||
@ -1114,7 +1118,7 @@ void LibraryModel::GetChildSongs(LibraryItem* item, QList<QUrl>* urls,
|
||||
const_cast<LibraryModel*>(this)->LazyPopulate(item);
|
||||
|
||||
QList<LibraryItem*> children = item->children;
|
||||
qSort(children.begin(), children.end(), boost::bind(
|
||||
qSort(children.begin(), children.end(), std::bind(
|
||||
&LibraryModel::CompareItems, this, _1, _2));
|
||||
|
||||
foreach (LibraryItem* child, children)
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include "playlist/playlistmanager.h"
|
||||
#include "smartplaylists/generator_fwd.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class Application;
|
||||
class AlbumCoverLoader;
|
||||
class LibraryDirectoryModel;
|
||||
|
@ -15,10 +15,22 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "libraryview.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QHelpEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSet>
|
||||
#include <QSettings>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QToolTip>
|
||||
#include <QWhatsThis>
|
||||
|
||||
#include "librarydirectorymodel.h"
|
||||
#include "libraryfilterwidget.h"
|
||||
#include "librarymodel.h"
|
||||
#include "libraryview.h"
|
||||
#include "libraryitem.h"
|
||||
#include "librarybackend.h"
|
||||
#include "core/application.h"
|
||||
@ -34,17 +46,6 @@
|
||||
#include "ui/organisedialog.h"
|
||||
#include "ui/organiseerrordialog.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QHelpEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSet>
|
||||
#include <QSettings>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QToolTip>
|
||||
#include <QWhatsThis>
|
||||
|
||||
using smart_playlists::Wizard;
|
||||
|
||||
const char* LibraryView::kSettingsGroup = "LibraryView";
|
||||
@ -613,9 +614,9 @@ void LibraryView::Delete() {
|
||||
// We can cheat and always take the storage of the first directory, since
|
||||
// they'll all be FilesystemMusicStorage in a library and deleting doesn't
|
||||
// check the actual directory.
|
||||
boost::shared_ptr<MusicStorage> storage =
|
||||
std::shared_ptr<MusicStorage> storage =
|
||||
app_->library_model()->directory_model()->index(0, 0).data(MusicStorage::Role_Storage)
|
||||
.value<boost::shared_ptr<MusicStorage> >();
|
||||
.value<std::shared_ptr<MusicStorage>>();
|
||||
|
||||
DeleteFiles* delete_files = new DeleteFiles(app_->task_manager(), storage);
|
||||
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
|
||||
|
@ -18,13 +18,13 @@
|
||||
#ifndef LIBRARYVIEW_H
|
||||
#define LIBRARYVIEW_H
|
||||
|
||||
#include "core/song.h"
|
||||
#include "ui/edittagdialog.h"
|
||||
#include "widgets/autoexpandingtreeview.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "core/song.h"
|
||||
#include "ui/edittagdialog.h"
|
||||
#include "widgets/autoexpandingtreeview.h"
|
||||
|
||||
class Application;
|
||||
class LibraryFilterWidget;
|
||||
@ -140,8 +140,8 @@ class LibraryView : public AutoExpandingTreeView {
|
||||
QAction* edit_smart_playlist_;
|
||||
QAction* delete_smart_playlist_;
|
||||
|
||||
boost::scoped_ptr<OrganiseDialog> organise_dialog_;
|
||||
boost::scoped_ptr<EditTagDialog> edit_tag_dialog_;
|
||||
std::unique_ptr<OrganiseDialog> organise_dialog_;
|
||||
std::unique_ptr<EditTagDialog> edit_tag_dialog_;
|
||||
|
||||
bool is_in_keyboard_search_;
|
||||
|
||||
|
33
src/main.cpp
33
src/main.cpp
@ -15,6 +15,8 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
@ -23,6 +25,19 @@
|
||||
# include <iostream>
|
||||
#endif // Q_OS_WIN32
|
||||
|
||||
#include <QDir>
|
||||
#include <QFont>
|
||||
#include <QLibraryInfo>
|
||||
#include <QNetworkProxyFactory>
|
||||
#include <QSslSocket>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QSysInfo>
|
||||
#include <QTextCodec>
|
||||
#include <QTranslator>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "config.h"
|
||||
#include "core/application.h"
|
||||
#include "core/commandlineoptions.h"
|
||||
@ -54,26 +69,10 @@
|
||||
#include "qtsingleapplication.h"
|
||||
#include "qtsinglecoreapplication.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFont>
|
||||
#include <QLibraryInfo>
|
||||
#include <QNetworkProxyFactory>
|
||||
#include <QSslSocket>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QSysInfo>
|
||||
#include <QTextCodec>
|
||||
#include <QTranslator>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <glib.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
using boost::scoped_ptr;
|
||||
|
||||
#include <echonest/Config.h>
|
||||
|
||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
||||
@ -449,7 +448,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif // Q_OS_LINUX
|
||||
|
||||
// Create the tray icon and OSD
|
||||
scoped_ptr<SystemTrayIcon> tray_icon(SystemTrayIcon::CreateSystemTrayIcon());
|
||||
std::unique_ptr<SystemTrayIcon> tray_icon(SystemTrayIcon::CreateSystemTrayIcon());
|
||||
OSD osd(tray_icon.get(), &app);
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "moodbarloader.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
@ -101,7 +101,7 @@ MoodbarLoader::Result MoodbarLoader::Load(
|
||||
}
|
||||
|
||||
// Maybe it exists in the cache?
|
||||
boost::scoped_ptr<QIODevice> cache_device(cache_->data(url));
|
||||
std::unique_ptr<QIODevice> cache_device(cache_->data(url));
|
||||
if (cache_device) {
|
||||
qLog(Info) << "Loading cached moodbar data for" << filename;
|
||||
*data = cache_device->readAll();
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef NETWORKREMOTE_H
|
||||
#define NETWORKREMOTE_H
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
@ -30,10 +30,10 @@ public slots:
|
||||
void SendKitten(quint64 id, const QImage& kitten);
|
||||
|
||||
private:
|
||||
boost::scoped_ptr<QTcpServer> server_;
|
||||
boost::scoped_ptr<QTcpServer> server_ipv6_;
|
||||
boost::scoped_ptr<IncomingDataParser> incoming_data_parser_;
|
||||
boost::scoped_ptr<OutgoingDataCreator> outgoing_data_creator_;
|
||||
std::unique_ptr<QTcpServer> server_;
|
||||
std::unique_ptr<QTcpServer> server_ipv6_;
|
||||
std::unique_ptr<IncomingDataParser> incoming_data_parser_;
|
||||
std::unique_ptr<OutgoingDataCreator> outgoing_data_creator_;
|
||||
|
||||
quint16 port_;
|
||||
bool use_remote_;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef OUTGOINGDATACREATOR_H
|
||||
#define OUTGOINGDATACREATOR_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include <QImage>
|
||||
#include <QList>
|
||||
@ -24,7 +26,6 @@
|
||||
#include "songinfo/ultimatelyricsreader.h"
|
||||
#include "remotecontrolmessages.pb.h"
|
||||
#include "remoteclient.h"
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
typedef QList<SongInfoProvider*> ProviderList;
|
||||
|
||||
@ -91,7 +92,7 @@ private:
|
||||
int last_track_position_;
|
||||
bool aww_;
|
||||
|
||||
boost::scoped_ptr<UltimateLyricsReader> ultimate_reader_;
|
||||
std::unique_ptr<UltimateLyricsReader> ultimate_reader_;
|
||||
ProviderList provider_list_;
|
||||
QMap<int, SongInfoFetcher::Result> results_;
|
||||
SongInfoFetcher* fetcher_;
|
||||
|
@ -16,6 +16,25 @@
|
||||
*/
|
||||
|
||||
#include "playlist.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QBuffer>
|
||||
#include <QCoreApplication>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
#include <QLinkedList>
|
||||
#include <QMimeData>
|
||||
#include <QMutableListIterator>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QUndoStack>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "playlistbackend.h"
|
||||
#include "playlistfilter.h"
|
||||
#include "playlistitemmimedata.h"
|
||||
@ -49,36 +68,15 @@
|
||||
#include "smartplaylists/generatorinserter.h"
|
||||
#include "smartplaylists/generatormimedata.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QBuffer>
|
||||
#include <QCoreApplication>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
#include <QLinkedList>
|
||||
#include <QMimeData>
|
||||
#include <QMutableListIterator>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QUndoStack>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#ifdef USE_STD_UNORDERED_MAP
|
||||
#include <unordered_map>
|
||||
using std::unordered_map;
|
||||
#else
|
||||
#include <tr1/unordered_map>
|
||||
using std::tr1::unordered_map;
|
||||
#endif
|
||||
using std::placeholders::_1;
|
||||
using std::placeholders::_2;
|
||||
using std::shared_ptr;
|
||||
using std::unordered_map;
|
||||
|
||||
using smart_playlists::Generator;
|
||||
using smart_playlists::GeneratorInserter;
|
||||
using smart_playlists::GeneratorPtr;
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
||||
const char* Playlist::kCddaMimeType = "x-content/audio-cdda";
|
||||
const char* Playlist::kRowsMimetype = "application/x-clementine-playlist-rows";
|
||||
const char* Playlist::kPlayNowMimetype = "application/x-clementine-play-now";
|
||||
@ -1267,7 +1265,7 @@ void Playlist::sort(int column, Qt::SortOrder order) {
|
||||
begin += current_item_index_.row() + 1;
|
||||
|
||||
qStableSort(begin, new_items.end(),
|
||||
boost::bind(&Playlist::CompareItems, column, order, _1, _2));
|
||||
std::bind(&Playlist::CompareItems, column, order, _1, _2));
|
||||
|
||||
undo_stack_->push(new PlaylistUndoCommands::SortItems(this, column, order, new_items));
|
||||
}
|
||||
@ -1814,8 +1812,8 @@ void Playlist::ReshuffleIndices() {
|
||||
|
||||
// Sort the virtual items
|
||||
std::stable_sort(begin, end,
|
||||
boost::bind(AlbumShuffleComparator, album_key_positions,
|
||||
album_keys, _1, _2));
|
||||
std::bind(AlbumShuffleComparator, album_key_positions,
|
||||
album_keys, _1, _2));
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <QAbstractItemModel>
|
||||
#include <QList>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "playlistitem.h"
|
||||
#include "playlistsequence.h"
|
||||
#include "core/tagreaderclient.h"
|
||||
|
@ -16,6 +16,17 @@
|
||||
*/
|
||||
|
||||
#include "playlistbackend.h"
|
||||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
#include <QFile>
|
||||
#include <QHash>
|
||||
#include <QMutexLocker>
|
||||
#include <QSqlQuery>
|
||||
#include <QtConcurrentMap>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/database.h"
|
||||
#include "core/scopedtransaction.h"
|
||||
@ -26,19 +37,11 @@
|
||||
#include "playlistparsers/cueparser.h"
|
||||
#include "smartplaylists/generator.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QHash>
|
||||
#include <QMutexLocker>
|
||||
#include <QSqlQuery>
|
||||
#include <QtConcurrentMap>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
using std::placeholders::_1;
|
||||
using std::shared_ptr;
|
||||
|
||||
using smart_playlists::GeneratorPtr;
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
||||
const int PlaylistBackend::kSongTableJoins = 4;
|
||||
|
||||
PlaylistBackend::PlaylistBackend(Application* app, QObject* parent)
|
||||
@ -174,8 +177,10 @@ QFuture<PlaylistItemPtr> PlaylistBackend::GetPlaylistItems(int playlist) {
|
||||
|
||||
// it's probable that we'll have a few songs associated with the
|
||||
// same CUE so we're caching results of parsing CUEs
|
||||
boost::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
||||
return QtConcurrent::mapped(rows, boost::bind(&PlaylistBackend::NewPlaylistItemFromQuery, this, _1, state_ptr));
|
||||
std::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
||||
return QtConcurrent::mapped(
|
||||
rows, std::bind(
|
||||
&PlaylistBackend::NewPlaylistItemFromQuery, this, _1, state_ptr));
|
||||
}
|
||||
|
||||
QFuture<Song> PlaylistBackend::GetPlaylistSongs(int playlist) {
|
||||
@ -184,11 +189,12 @@ QFuture<Song> PlaylistBackend::GetPlaylistSongs(int playlist) {
|
||||
|
||||
// it's probable that we'll have a few songs associated with the
|
||||
// same CUE so we're caching results of parsing CUEs
|
||||
boost::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
||||
return QtConcurrent::mapped(rows, boost::bind(&PlaylistBackend::NewSongFromQuery, this, _1, state_ptr));
|
||||
std::shared_ptr<NewSongFromQueryState> state_ptr(new NewSongFromQueryState());
|
||||
return QtConcurrent::mapped(rows, std::bind(&PlaylistBackend::NewSongFromQuery, this, _1, state_ptr));
|
||||
}
|
||||
|
||||
PlaylistItemPtr PlaylistBackend::NewPlaylistItemFromQuery(const SqlRow& row, boost::shared_ptr<NewSongFromQueryState> state) {
|
||||
PlaylistItemPtr PlaylistBackend::NewPlaylistItemFromQuery(
|
||||
const SqlRow& row, std::shared_ptr<NewSongFromQueryState> state) {
|
||||
// The song tables get joined first, plus one each for the song ROWIDs
|
||||
const int playlist_row = (Song::kColumns.count() + 1) * kSongTableJoins;
|
||||
|
||||
@ -201,13 +207,15 @@ PlaylistItemPtr PlaylistBackend::NewPlaylistItemFromQuery(const SqlRow& row, boo
|
||||
}
|
||||
}
|
||||
|
||||
Song PlaylistBackend::NewSongFromQuery(const SqlRow& row, boost::shared_ptr<NewSongFromQueryState> state) {
|
||||
Song PlaylistBackend::NewSongFromQuery(
|
||||
const SqlRow& row, std::shared_ptr<NewSongFromQueryState> state) {
|
||||
return NewPlaylistItemFromQuery(row, state)->Metadata();
|
||||
}
|
||||
|
||||
// If song had a CUE and the CUE still exists, the metadata from it will
|
||||
// be applied here.
|
||||
PlaylistItemPtr PlaylistBackend::RestoreCueData(PlaylistItemPtr item, boost::shared_ptr<NewSongFromQueryState> state) {
|
||||
PlaylistItemPtr PlaylistBackend::RestoreCueData(
|
||||
PlaylistItemPtr item, std::shared_ptr<NewSongFromQueryState> state) {
|
||||
// we need library to run a CueParser; also, this method applies only to
|
||||
// file-type PlaylistItems
|
||||
if(item->type() != "File") {
|
||||
|
@ -92,9 +92,9 @@ class PlaylistBackend : public QObject {
|
||||
|
||||
QList<SqlRow> GetPlaylistRows(int playlist);
|
||||
|
||||
Song NewSongFromQuery(const SqlRow& row, boost::shared_ptr<NewSongFromQueryState> state);
|
||||
PlaylistItemPtr NewPlaylistItemFromQuery(const SqlRow& row, boost::shared_ptr<NewSongFromQueryState> state);
|
||||
PlaylistItemPtr RestoreCueData(PlaylistItemPtr item, boost::shared_ptr<NewSongFromQueryState> state);
|
||||
Song NewSongFromQuery(const SqlRow& row, std::shared_ptr<NewSongFromQueryState> state);
|
||||
PlaylistItemPtr NewPlaylistItemFromQuery(const SqlRow& row, std::shared_ptr<NewSongFromQueryState> state);
|
||||
PlaylistItemPtr RestoreCueData(PlaylistItemPtr item, std::shared_ptr<NewSongFromQueryState> state);
|
||||
|
||||
enum GetPlaylistsFlags {
|
||||
GetPlaylists_OpenInUi = 1,
|
||||
|
@ -18,19 +18,19 @@
|
||||
#ifndef PLAYLISTITEM_H
|
||||
#define PLAYLISTITEM_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QMap>
|
||||
#include <QMetaType>
|
||||
#include <QStandardItem>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
||||
#include "core/song.h"
|
||||
|
||||
class QAction;
|
||||
class SqlRow;
|
||||
|
||||
class PlaylistItem : public boost::enable_shared_from_this<PlaylistItem> {
|
||||
class PlaylistItem : public std::enable_shared_from_this<PlaylistItem> {
|
||||
public:
|
||||
PlaylistItem(const QString& type)
|
||||
: type_(type) {}
|
||||
@ -109,7 +109,7 @@ class PlaylistItem : public boost::enable_shared_from_this<PlaylistItem> {
|
||||
QMap<short, QColor> background_colors_;
|
||||
QMap<short, QColor> foreground_colors_;
|
||||
};
|
||||
typedef boost::shared_ptr<PlaylistItem> PlaylistItemPtr;
|
||||
typedef std::shared_ptr<PlaylistItem> PlaylistItemPtr;
|
||||
typedef QList<PlaylistItemPtr> PlaylistItemList;
|
||||
|
||||
Q_DECLARE_METATYPE(PlaylistItemPtr)
|
||||
|
@ -18,12 +18,12 @@
|
||||
#ifndef PLAYLISTSEQUENCE_H
|
||||
#define PLAYLISTSEQUENCE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "core/settingsprovider.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class QMenu;
|
||||
|
||||
class Ui_PlaylistSequence;
|
||||
@ -79,7 +79,7 @@ class PlaylistSequence : public QWidget {
|
||||
|
||||
private:
|
||||
Ui_PlaylistSequence* ui_;
|
||||
boost::scoped_ptr<SettingsProvider> settings_;
|
||||
std::unique_ptr<SettingsProvider> settings_;
|
||||
|
||||
QMenu* repeat_menu_;
|
||||
QMenu* shuffle_menu_;
|
||||
|
@ -18,13 +18,13 @@
|
||||
#ifndef PLAYLISTVIEW_H
|
||||
#define PLAYLISTVIEW_H
|
||||
|
||||
#include "playlist.h"
|
||||
#include <memory>
|
||||
|
||||
#include <QBasicTimer>
|
||||
#include <QProxyStyle>
|
||||
#include <QTreeView>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "playlist.h"
|
||||
|
||||
class QCleanlooksStyle;
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
QPainter* painter, const QWidget* widget) const;
|
||||
|
||||
private:
|
||||
boost::scoped_ptr<QCleanlooksStyle> cleanlooks_;
|
||||
std::unique_ptr<QCleanlooksStyle> cleanlooks_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
class QDomDocument;
|
||||
class QDomNode;
|
||||
|
||||
@ -32,7 +30,7 @@ class XMLParser : public ParserBase {
|
||||
protected:
|
||||
XMLParser(LibraryBackendInterface* library, QObject* parent);
|
||||
|
||||
class StreamElement : public boost::noncopyable {
|
||||
class StreamElement {
|
||||
public:
|
||||
StreamElement(const QString& name, QXmlStreamWriter* stream) : stream_(stream) {
|
||||
stream->writeStartElement(name);
|
||||
@ -44,6 +42,7 @@ class XMLParser : public ParserBase {
|
||||
|
||||
private:
|
||||
QXmlStreamWriter* stream_;
|
||||
Q_DISABLE_COPY(StreamElement);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -20,14 +20,13 @@
|
||||
|
||||
#include "playlist/playlistitem.h"
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
class LibraryBackend;
|
||||
|
||||
namespace smart_playlists {
|
||||
|
||||
class Generator : public QObject, public boost::enable_shared_from_this<Generator> {
|
||||
class Generator : public QObject, public std::enable_shared_from_this<Generator> {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -38,7 +37,7 @@ public:
|
||||
static const int kDefaultDynamicFuture;
|
||||
|
||||
// Creates a new Generator of the given type
|
||||
static boost::shared_ptr<Generator> Create(const QString& type);
|
||||
static std::shared_ptr<Generator> Create(const QString& type);
|
||||
|
||||
// Should be called before Load on a new Generator
|
||||
void set_library(LibraryBackend* backend) { backend_ = backend; }
|
||||
|
@ -18,13 +18,13 @@
|
||||
#ifndef PLAYLISTGENERATOR_FWD_H
|
||||
#define PLAYLISTGENERATOR_FWD_H
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace smart_playlists {
|
||||
|
||||
class Generator;
|
||||
|
||||
typedef boost::shared_ptr<Generator> GeneratorPtr;
|
||||
typedef std::shared_ptr<Generator> GeneratorPtr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
SearchPreview* preview_;
|
||||
|
||||
boost::scoped_ptr<Ui_SmartPlaylistQuerySearchPage> ui_;
|
||||
std::unique_ptr<Ui_SmartPlaylistQuerySearchPage> ui_;
|
||||
};
|
||||
|
||||
class QueryWizardPlugin::SortPage : public QWizardPage {
|
||||
@ -161,8 +161,8 @@ int QueryWizardPlugin::CreatePages(QWizard* wizard, int finish_page_id) {
|
||||
}
|
||||
|
||||
void QueryWizardPlugin::SetGenerator(GeneratorPtr g) {
|
||||
boost::shared_ptr<QueryGenerator> gen =
|
||||
boost::dynamic_pointer_cast<QueryGenerator>(g);
|
||||
std::shared_ptr<QueryGenerator> gen =
|
||||
std::dynamic_pointer_cast<QueryGenerator>(g);
|
||||
if (!gen)
|
||||
return;
|
||||
Search search = gen->search();
|
||||
@ -198,10 +198,10 @@ void QueryWizardPlugin::SetGenerator(GeneratorPtr g) {
|
||||
}
|
||||
|
||||
GeneratorPtr QueryWizardPlugin::CreateGenerator() const {
|
||||
boost::shared_ptr<QueryGenerator> gen(new QueryGenerator);
|
||||
std::shared_ptr<QueryGenerator> gen(new QueryGenerator);
|
||||
gen->Load(MakeSearch());
|
||||
|
||||
return boost::static_pointer_cast<Generator>(gen);
|
||||
return std::static_pointer_cast<Generator>(gen);
|
||||
}
|
||||
|
||||
void QueryWizardPlugin::UpdateSortOrder() {
|
||||
|
@ -18,12 +18,13 @@
|
||||
#ifndef QUERYWIZARDPLUGIN_H
|
||||
#define QUERYWIZARDPLUGIN_H
|
||||
|
||||
#include "search.h"
|
||||
#include "wizardplugin.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QWizard>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "search.h"
|
||||
|
||||
class Ui_SmartPlaylistQuerySearchPage;
|
||||
class Ui_SmartPlaylistQuerySortPage;
|
||||
@ -70,7 +71,7 @@ private:
|
||||
Search MakeSearch() const;
|
||||
|
||||
SearchPage* search_page_;
|
||||
boost::scoped_ptr<Ui_SmartPlaylistQuerySortPage> sort_ui_;
|
||||
std::unique_ptr<Ui_SmartPlaylistQuerySortPage> sort_ui_;
|
||||
|
||||
int previous_scrollarea_max_;
|
||||
};
|
||||
|
@ -15,14 +15,17 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "querygenerator.h"
|
||||
#include "searchpreview.h"
|
||||
#include "ui_searchpreview.h"
|
||||
#include "playlist/playlist.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
#include "querygenerator.h"
|
||||
#include "playlist/playlist.h"
|
||||
|
||||
namespace smart_playlists {
|
||||
|
||||
typedef QFuture<PlaylistItemList> Future;
|
||||
@ -94,7 +97,7 @@ PlaylistItemList DoRunSearch(GeneratorPtr gen) {
|
||||
void SearchPreview::RunSearch(const Search& search) {
|
||||
generator_.reset(new QueryGenerator);
|
||||
generator_->set_library(backend_);
|
||||
boost::dynamic_pointer_cast<QueryGenerator>(generator_)->Load(search);
|
||||
std::dynamic_pointer_cast<QueryGenerator>(generator_)->Load(search);
|
||||
|
||||
ui_->busy_container->show();
|
||||
ui_->count_label->hide();
|
||||
@ -109,7 +112,7 @@ void SearchPreview::SearchFinished() {
|
||||
FutureWatcher* watcher = static_cast<FutureWatcher*>(sender());
|
||||
watcher->deleteLater();
|
||||
|
||||
last_search_ = boost::dynamic_pointer_cast<QueryGenerator>(generator_)->search();
|
||||
last_search_ = std::dynamic_pointer_cast<QueryGenerator>(generator_)->search();
|
||||
generator_.reset();
|
||||
|
||||
if (pending_search_.is_valid() && pending_search_ != last_search_) {
|
||||
|
@ -16,18 +16,19 @@
|
||||
*/
|
||||
|
||||
#include "echonestbiographies.h"
|
||||
#include "songinfotextview.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <echonest/Artist.h>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "songinfotextview.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
struct EchoNestBiographies::Request {
|
||||
Request(int id) : id_(id), artist_(new Echonest::Artist) {}
|
||||
|
||||
int id_;
|
||||
boost::scoped_ptr<Echonest::Artist> artist_;
|
||||
std::unique_ptr<Echonest::Artist> artist_;
|
||||
};
|
||||
|
||||
EchoNestBiographies::EchoNestBiographies() {
|
||||
@ -46,7 +47,7 @@ EchoNestBiographies::EchoNestBiographies() {
|
||||
}
|
||||
|
||||
void EchoNestBiographies::FetchInfo(int id, const Song& metadata) {
|
||||
boost::shared_ptr<Request> request(new Request(id));
|
||||
std::shared_ptr<Request> request(new Request(id));
|
||||
request->artist_->setName(metadata.artist());
|
||||
|
||||
QNetworkReply* reply = request->artist_->fetchBiographies();
|
||||
@ -70,7 +71,7 @@ void EchoNestBiographies::RequestFinished() {
|
||||
|
||||
QSet<QString> already_seen;
|
||||
|
||||
foreach (const Echonest::Biography& bio, request->artist_->biographies()) {
|
||||
for (const Echonest::Biography& bio : request->artist_->biographies()) {
|
||||
QString canonical_site = bio.site().toLower();
|
||||
canonical_site.replace(QRegExp("[^a-z]"),"");
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef ECHONESTBIOGRAPHIES_H
|
||||
#define ECHONESTBIOGRAPHIES_H
|
||||
|
||||
#include "songinfoprovider.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "songinfoprovider.h"
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
@ -40,7 +40,7 @@ private:
|
||||
QMap<QString, QIcon> site_icons_;
|
||||
|
||||
struct Request;
|
||||
typedef boost::shared_ptr<Request> RequestPtr;
|
||||
typedef std::shared_ptr<Request> RequestPtr;
|
||||
|
||||
QMap<QNetworkReply*, RequestPtr> requests_;
|
||||
};
|
||||
|
@ -16,21 +16,22 @@
|
||||
*/
|
||||
|
||||
#include "echonestimages.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <echonest/Artist.h>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "core/logging.h"
|
||||
|
||||
struct EchoNestImages::Request {
|
||||
Request(int id) : id_(id), artist_(new Echonest::Artist) {}
|
||||
|
||||
int id_;
|
||||
boost::scoped_ptr<Echonest::Artist> artist_;
|
||||
std::unique_ptr<Echonest::Artist> artist_;
|
||||
};
|
||||
|
||||
void EchoNestImages::FetchInfo(int id, const Song& metadata) {
|
||||
boost::shared_ptr<Request> request(new Request(id));
|
||||
std::shared_ptr<Request> request(new Request(id));
|
||||
request->artist_->setName(metadata.artist());
|
||||
|
||||
QNetworkReply* reply = request->artist_->fetchImages();
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef ECHONESTIMAGES_H
|
||||
#define ECHONESTIMAGES_H
|
||||
|
||||
#include "songinfoprovider.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "songinfoprovider.h"
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
@ -35,7 +35,7 @@ private slots:
|
||||
|
||||
private:
|
||||
struct Request;
|
||||
typedef boost::shared_ptr<Request> RequestPtr;
|
||||
typedef std::shared_ptr<Request> RequestPtr;
|
||||
|
||||
QMap<QNetworkReply*, RequestPtr> requests_;
|
||||
};
|
||||
|
@ -16,22 +16,23 @@
|
||||
*/
|
||||
|
||||
#include "echonesttags.h"
|
||||
#include "tagwidget.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <echonest/Artist.h>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "tagwidget.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
struct EchoNestTags::Request {
|
||||
Request(int id) : id_(id), artist_(new Echonest::Artist) {}
|
||||
|
||||
int id_;
|
||||
boost::scoped_ptr<Echonest::Artist> artist_;
|
||||
std::unique_ptr<Echonest::Artist> artist_;
|
||||
};
|
||||
|
||||
void EchoNestTags::FetchInfo(int id, const Song& metadata) {
|
||||
boost::shared_ptr<Request> request(new Request(id));
|
||||
std::shared_ptr<Request> request(new Request(id));
|
||||
request->artist_->setName(metadata.artist());
|
||||
|
||||
QNetworkReply* reply = request->artist_->fetchTerms();
|
||||
@ -65,7 +66,7 @@ void EchoNestTags::RequestFinished() {
|
||||
|
||||
widget->SetIcon(data.icon_);
|
||||
|
||||
foreach (const Echonest::Term& term, request->artist_->terms()) {
|
||||
for (const Echonest::Term& term : request->artist_->terms()) {
|
||||
widget->AddTag(term.name());
|
||||
if (widget->count() >= 10)
|
||||
break;
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef ECHONESTTAGS_H
|
||||
#define ECHONESTTAGS_H
|
||||
|
||||
#include "songinfoprovider.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "songinfoprovider.h"
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
@ -35,7 +35,7 @@ private slots:
|
||||
|
||||
private:
|
||||
struct Request;
|
||||
typedef boost::shared_ptr<Request> RequestPtr;
|
||||
typedef std::shared_ptr<Request> RequestPtr;
|
||||
|
||||
QMap<QNetworkReply*, RequestPtr> requests_;
|
||||
};
|
||||
|
@ -18,9 +18,9 @@
|
||||
#ifndef SONGINFOVIEW_H
|
||||
#define SONGINFOVIEW_H
|
||||
|
||||
#include "songinfobase.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "songinfobase.h"
|
||||
|
||||
class UltimateLyricsProvider;
|
||||
class UltimateLyricsReader;
|
||||
@ -53,7 +53,7 @@ private slots:
|
||||
void UltimateLyricsParsed();
|
||||
|
||||
private:
|
||||
boost::scoped_ptr<UltimateLyricsReader> ultimate_reader_;
|
||||
std::unique_ptr<UltimateLyricsReader> ultimate_reader_;
|
||||
};
|
||||
|
||||
#endif // SONGINFOVIEW_H
|
||||
|
@ -26,8 +26,6 @@
|
||||
#include <QTextCodec>
|
||||
#include <QThread>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
const int UltimateLyricsProvider::kRedirectLimit = 5;
|
||||
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include "transcoder.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
@ -24,12 +26,10 @@
|
||||
#include <QThread>
|
||||
#include <QtDebug>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include "core/logging.h"
|
||||
#include "core/signalchecker.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using std::shared_ptr;
|
||||
|
||||
int Transcoder::JobFinishedEvent::sEventType = -1;
|
||||
|
||||
@ -543,7 +543,7 @@ void Transcoder::Cancel() {
|
||||
QMap<QString, float> Transcoder::GetProgress() const {
|
||||
QMap<QString, float> ret;
|
||||
|
||||
foreach (boost::shared_ptr<JobState> state, current_jobs_) {
|
||||
for (const auto& state : current_jobs_) {
|
||||
if (!state->pipeline_)
|
||||
continue;
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef TRANSCODER_H
|
||||
#define TRANSCODER_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <QObject>
|
||||
@ -25,9 +27,6 @@
|
||||
#include <QEvent>
|
||||
#include <QMetaType>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "core/song.h"
|
||||
|
||||
|
||||
@ -139,7 +138,7 @@ class Transcoder : public QObject {
|
||||
static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage* msg, gpointer data);
|
||||
|
||||
private:
|
||||
typedef QList<boost::shared_ptr<JobState> > JobStateList;
|
||||
typedef QList<std::shared_ptr<JobState> > JobStateList;
|
||||
|
||||
int max_threads_;
|
||||
QList<Job> queued_jobs_;
|
||||
|
@ -211,7 +211,7 @@ void AlbumCoverManager::showEvent(QShowEvent *) {
|
||||
|
||||
void AlbumCoverManager::closeEvent(QCloseEvent* e) {
|
||||
if (!cover_fetching_tasks_.isEmpty()) {
|
||||
boost::scoped_ptr<QMessageBox> message_box(new QMessageBox(
|
||||
std::unique_ptr<QMessageBox> message_box(new QMessageBox(
|
||||
QMessageBox::Question, tr("Really cancel?"),
|
||||
tr("Closing this window will stop searching for album covers."),
|
||||
QMessageBox::Abort, this));
|
||||
|
@ -15,16 +15,17 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "albumcovermanager.h"
|
||||
#include "albumcovermanagerlist.h"
|
||||
#include "library/librarybackend.h"
|
||||
#include "playlist/songmimedata.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <QDropEvent>
|
||||
#include <QUrl>
|
||||
|
||||
#include "albumcovermanager.h"
|
||||
#include "library/librarybackend.h"
|
||||
#include "playlist/songmimedata.h"
|
||||
|
||||
AlbumCoverManagerList::AlbumCoverManagerList(QWidget *parent)
|
||||
: QListWidget(parent),
|
||||
manager_(NULL)
|
||||
@ -48,7 +49,7 @@ QMimeData* AlbumCoverManagerList::mimeData(const QList<QListWidgetItem*> items)
|
||||
}
|
||||
|
||||
// Get the QAbstractItemModel data so the picture works
|
||||
boost::scoped_ptr<QMimeData> orig_data(QListWidget::mimeData(items));
|
||||
std::unique_ptr<QMimeData> orig_data(QListWidget::mimeData(items));
|
||||
|
||||
SongMimeData* mime_data = new SongMimeData;
|
||||
mime_data->backend = manager_->backend();
|
||||
|
@ -18,14 +18,12 @@
|
||||
#ifndef ALBUMCOVERSEARCHER_H
|
||||
#define ALBUMCOVERSEARCHER_H
|
||||
|
||||
#include "covers/albumcoverfetcher.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QIcon>
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "covers/albumcoverfetcher.h"
|
||||
#include "covers/albumcoverloaderoptions.h"
|
||||
|
||||
class AlbumCoverLoader;
|
||||
class Application;
|
||||
@ -35,7 +33,6 @@ class QModelIndex;
|
||||
class QStandardItem;
|
||||
class QStandardItemModel;
|
||||
|
||||
|
||||
class SizeOverlayDelegate : public QStyledItemDelegate {
|
||||
public:
|
||||
static const int kMargin;
|
||||
|
@ -24,11 +24,9 @@
|
||||
|
||||
#include <QKeySequence>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#import "core/mac_utilities.h"
|
||||
|
||||
class MacMonitorWrapper : boost::noncopyable {
|
||||
class MacMonitorWrapper {
|
||||
public:
|
||||
explicit MacMonitorWrapper(id monitor) : local_monitor_(monitor) {}
|
||||
|
||||
@ -36,6 +34,7 @@ class MacMonitorWrapper : boost::noncopyable {
|
||||
|
||||
private:
|
||||
id local_monitor_;
|
||||
Q_DISABLE_COPY(MacMonitorWrapper);
|
||||
};
|
||||
|
||||
bool GlobalShortcutGrabber::HandleMacEvent(NSEvent* event) {
|
||||
|
@ -18,11 +18,11 @@
|
||||
#ifndef GLOBALSHORTCUTSSETTINGSPAGE_H
|
||||
#define GLOBALSHORTCUTSSETTINGSPAGE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QMap>
|
||||
#include <QSettings>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "core/globalshortcuts.h"
|
||||
#include "ui/settingspage.h"
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
Ui_GlobalShortcutsSettingsPage* ui_;
|
||||
|
||||
bool initialised_;
|
||||
boost::scoped_ptr<GlobalShortcutGrabber> grabber_;
|
||||
std::unique_ptr<GlobalShortcutGrabber> grabber_;
|
||||
|
||||
QSettings settings_;
|
||||
QMap<QString, Shortcut> shortcuts_;
|
||||
|
@ -18,14 +18,13 @@
|
||||
#ifndef MACSYSTEMTRAYICON_H
|
||||
#define MACSYSTEMTRAYICON_H
|
||||
|
||||
#include "systemtrayicon.h"
|
||||
#include <memory>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "systemtrayicon.h"
|
||||
|
||||
class MacSystemTrayIconPrivate;
|
||||
|
||||
class MacSystemTrayIcon : public SystemTrayIcon, boost::noncopyable {
|
||||
class MacSystemTrayIcon : public SystemTrayIcon {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@ -52,8 +51,8 @@ protected:
|
||||
private:
|
||||
QPixmap orange_icon_;
|
||||
QPixmap grey_icon_;
|
||||
|
||||
boost::scoped_ptr<MacSystemTrayIconPrivate> p_;
|
||||
std::unique_ptr<MacSystemTrayIconPrivate> p_;
|
||||
Q_DISABLE_COPY(MacSystemTrayIcon);
|
||||
};
|
||||
|
||||
#endif // MACSYSTEMTRAYICON_H
|
||||
|
@ -56,7 +56,7 @@
|
||||
}
|
||||
@end
|
||||
|
||||
class MacSystemTrayIconPrivate : boost::noncopyable {
|
||||
class MacSystemTrayIconPrivate {
|
||||
public:
|
||||
MacSystemTrayIconPrivate() {
|
||||
dock_menu_ = [[NSMenu alloc] initWithTitle:@"DockMenu"];
|
||||
@ -159,6 +159,8 @@ class MacSystemTrayIconPrivate : boost::noncopyable {
|
||||
NSMenuItem* now_playing_;
|
||||
NSMenuItem* now_playing_artist_;
|
||||
NSMenuItem* now_playing_title_;
|
||||
|
||||
Q_DISABLE_COPY(MacSystemTrayIconPrivate);
|
||||
};
|
||||
|
||||
MacSystemTrayIcon::MacSystemTrayIcon(QObject* parent)
|
||||
|
@ -17,6 +17,33 @@
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemModel>
|
||||
#include <QLinearGradient>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QShortcut>
|
||||
#include <QSignalMapper>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStatusBar>
|
||||
#include <QtDebug>
|
||||
#include <QTimer>
|
||||
#include <QUndoStack>
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
# include <qtsparkle/Updater>
|
||||
#endif
|
||||
|
||||
#include <gst/cdda/gstcddabasesrc.h>
|
||||
|
||||
|
||||
#include "core/appearance.h"
|
||||
#include "core/application.h"
|
||||
#include "core/backgroundstreams.h"
|
||||
@ -122,34 +149,6 @@
|
||||
# include "moodbar/moodbarproxystyle.h"
|
||||
#endif
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemModel>
|
||||
#include <QLinearGradient>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QShortcut>
|
||||
#include <QSignalMapper>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStatusBar>
|
||||
#include <QtDebug>
|
||||
#include <QTimer>
|
||||
#include <QUndoStack>
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
# include <qtsparkle/Updater>
|
||||
#endif
|
||||
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <gst/cdda/gstcddabasesrc.h>
|
||||
|
||||
using boost::shared_ptr;
|
||||
using boost::scoped_ptr;
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
// Non exported mac-specific function.
|
||||
void qt_mac_set_dock_menu(QMenu*);
|
||||
@ -180,18 +179,8 @@ MainWindow::MainWindow(Application* app,
|
||||
device_view_(device_view_container_->view()),
|
||||
song_info_view_(new SongInfoView(this)),
|
||||
artist_info_view_(new ArtistInfoView(this)),
|
||||
settings_dialog_(NULL),
|
||||
cover_manager_(NULL),
|
||||
equalizer_(new Equalizer),
|
||||
error_dialog_(NULL),
|
||||
organise_dialog_(new OrganiseDialog(app_->task_manager())),
|
||||
queue_manager_(NULL),
|
||||
#ifdef ENABLE_VISUALISATIONS
|
||||
visualisation_(NULL),
|
||||
#endif
|
||||
#ifdef HAVE_WIIMOTEDEV
|
||||
wiimotedev_shortcuts_(NULL),
|
||||
#endif
|
||||
playlist_menu_(new QMenu(this)),
|
||||
playlist_add_to_another_(NULL),
|
||||
playlistitem_actions_separator_(NULL),
|
||||
@ -1962,7 +1951,7 @@ void MainWindow::PlaylistDelete() {
|
||||
QMessageBox::Yes, QMessageBox::Cancel) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
boost::shared_ptr<MusicStorage> storage(new FilesystemMusicStorage("/"));
|
||||
std::shared_ptr<MusicStorage> storage(new FilesystemMusicStorage("/"));
|
||||
|
||||
// Get selected songs
|
||||
SongList selected_songs;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user