1
/* This file is part of Clementine.
2
Copyright 2010, David Sansome <me@davidsansome.com>
4
Clementine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
9
Clementine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
22
#include <QSharedData>
23
#include <QSharedDataPointer>
37
static const char* kIniFileName;
38
static const char* kIniSettingsGroup;
40
void InitFromDirectory(const ScriptManager* manager, const QString& path);
41
void InitFromFile(const ScriptManager* manager,
44
const QString& filename);
45
void TakeMetadataFrom(const ScriptInfo& other);
47
bool is_valid() const { return d->language_ != Language_Unknown; }
48
bool operator ==(const ScriptInfo& other) const;
49
bool operator !=(const ScriptInfo& other) const;
51
const QString& path() const { return d->path_; }
52
const QString& id() const { return d->id_; }
54
const QString& name() const { return d->name_; }
55
const QString& description() const { return d->description_; }
56
const QString& author() const { return d->author_; }
57
const QString& url() const { return d->url_; }
58
const QString& icon_filename() const { return d->icon_filename_; }
59
QIcon icon() const { return QIcon(icon_filename()); }
61
Language language() const { return d->language_; }
62
const QString& script_file() const { return d->script_file_; }
64
Script* loaded() const { return d->loaded_; }
65
void set_loaded(Script* loaded) { d->loaded_ = loaded; }
68
struct Private : public QSharedData {
69
Private() : language_(Language_Unknown), loaded_(NULL) {}
78
QString icon_filename_;
86
QSharedDataPointer<Private> d;
89
#endif // SCRIPTINFO_H