mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Add python bindings for the NetworkManager, SongLoader and IconLoader. Add a workaround for a SIP assertion bug (assign_helper != ((void *)0)) that was fixed in 4.10.3: http://www.riverbankcomputing.com/hg/sip/rev/3e647ed0f2a2
This commit is contained in:
parent
f49457b416
commit
32b599f70c
@ -2,12 +2,15 @@
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
%Import QtGui/QtGuimod.sip
|
||||
%Import QtNetwork/QtNetworkmod.sip
|
||||
|
||||
%Include directory.sip
|
||||
%Include engine_fwd.sip
|
||||
%Include iconloader.sip
|
||||
%Include librarybackend.sip
|
||||
%Include libraryquery.sip
|
||||
%Include mergedproxymodel.sip
|
||||
%Include network.sip
|
||||
%Include player.sip
|
||||
%Include playlist.sip
|
||||
%Include playlistitem.sip
|
||||
@ -20,5 +23,6 @@
|
||||
%Include scriptinterface.sip
|
||||
%Include settingsdialog.sip
|
||||
%Include song.sip
|
||||
%Include songloader.sip
|
||||
%Include taskmanager.sip
|
||||
%Include uiinterface.sip
|
||||
|
12
src/scripting/python/iconloader.sip
Normal file
12
src/scripting/python/iconloader.sip
Normal file
@ -0,0 +1,12 @@
|
||||
class IconLoader {
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "ui/iconloader.h"
|
||||
%End
|
||||
|
||||
public:
|
||||
static QIcon Load(const QString& name);
|
||||
|
||||
private:
|
||||
IconLoader();
|
||||
};
|
@ -20,7 +20,8 @@ class LibraryQuery {
|
||||
%End
|
||||
|
||||
public:
|
||||
LibraryQuery(const QueryOptions& options = QueryOptions());
|
||||
LibraryQuery(); // Workaround SIP Mercurial 3e647ed0f2a2
|
||||
LibraryQuery(const QueryOptions& options);
|
||||
|
||||
void SetColumnSpec(const QString& spec);
|
||||
void SetOrderBy(const QString& order_by);
|
||||
|
9
src/scripting/python/network.sip
Normal file
9
src/scripting/python/network.sip
Normal file
@ -0,0 +1,9 @@
|
||||
class NetworkAccessManager : QNetworkAccessManager {
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "core/network.h"
|
||||
%End
|
||||
|
||||
public:
|
||||
NetworkAccessManager(QObject* parent /TransferThis/ = 0);
|
||||
};
|
@ -33,7 +33,8 @@ public:
|
||||
TrackAvailable,
|
||||
};
|
||||
|
||||
SpecialLoadResult(Type type = NoMoreTracks,
|
||||
SpecialLoadResult(); // Workaround SIP Mercurial 3e647ed0f2a2
|
||||
SpecialLoadResult(Type type,
|
||||
const QUrl& original_url = QUrl(),
|
||||
const QUrl& media_url = QUrl());
|
||||
|
||||
|
28
src/scripting/python/songloader.sip
Normal file
28
src/scripting/python/songloader.sip
Normal file
@ -0,0 +1,28 @@
|
||||
class SongLoader : QObject {
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "core/songloader.h"
|
||||
%End
|
||||
|
||||
public:
|
||||
SongLoader(LibraryBackend* library, QObject* parent /TransferThis/ = 0);
|
||||
|
||||
enum Result {
|
||||
Success,
|
||||
Error,
|
||||
WillLoadAsync,
|
||||
};
|
||||
|
||||
static const int kDefaultTimeout;
|
||||
|
||||
const QUrl& url() const;
|
||||
const SongList& songs() const;
|
||||
|
||||
int timeout() const;
|
||||
void set_timeout(int msec);
|
||||
|
||||
Result Load(const QUrl& url);
|
||||
|
||||
signals:
|
||||
void LoadFinished(bool success);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user