minor code cleanups
This commit is contained in:
+8
-2
@@ -86,7 +86,8 @@ void Media::set_footage(FootagePtr f) {
|
||||
}
|
||||
|
||||
void Media::set_sequence(SequencePtr s) {
|
||||
set_icon(QIcon(":/icons/sequence.svg"));
|
||||
// ensure icon setting occurs in a separate thread
|
||||
set_icon(":/icons/sequence.svg");
|
||||
type = MEDIA_TYPE_SEQUENCE;
|
||||
object = VoidPtr(s);
|
||||
if (s != nullptr) update_tooltip();
|
||||
@@ -94,11 +95,16 @@ void Media::set_sequence(SequencePtr s) {
|
||||
|
||||
void Media::set_folder() {
|
||||
if (folder_name.isEmpty()) folder_name = QCoreApplication::translate("Media", "New Folder");
|
||||
set_icon(QIcon(":/icons/folder.svg"));
|
||||
set_icon(":/icons/folder.svg");
|
||||
type = MEDIA_TYPE_FOLDER;
|
||||
object = nullptr;
|
||||
}
|
||||
|
||||
void Media::set_icon(const QString &str)
|
||||
{
|
||||
set_icon(QIcon(str));
|
||||
}
|
||||
|
||||
void Media::set_icon(const QIcon &ico) {
|
||||
icon = ico;
|
||||
}
|
||||
|
||||
+4
-2
@@ -46,12 +46,13 @@ public:
|
||||
~Media();
|
||||
FootagePtr to_footage();
|
||||
SequencePtr to_sequence();
|
||||
void set_icon(const QString& str);
|
||||
void set_icon(const QIcon &ico);
|
||||
void set_footage(FootagePtr f);
|
||||
void set_sequence(SequencePtr s);
|
||||
void set_folder();
|
||||
void set_icon(const QIcon &ico);
|
||||
void set_parent(Media* p);
|
||||
void update_tooltip(const QString& error = 0);
|
||||
void update_tooltip(const QString& error = nullptr);
|
||||
VoidPtr to_object();
|
||||
int get_type();
|
||||
const QString& get_name();
|
||||
@@ -77,6 +78,7 @@ public:
|
||||
bool root;
|
||||
int temp_id;
|
||||
int temp_id2;
|
||||
|
||||
private:
|
||||
int type;
|
||||
VoidPtr object;
|
||||
|
||||
@@ -165,7 +165,6 @@ void ProjectModel::set_icon(Media* m, const QIcon &ico) {
|
||||
QModelIndex index = createIndex(m->row(), 0, m);
|
||||
m->set_icon(ico);
|
||||
emit dataChanged(index, index);
|
||||
|
||||
}
|
||||
|
||||
void ProjectModel::appendChild(Media *parent, Media *child) {
|
||||
|
||||
Reference in New Issue
Block a user