1 #include "browsedirectoryitem.h"
2 #include "xinemacontrol.h"
3 #include "xinemacontrolitem.h"
5 BrowseDirectoryItem::BrowseDirectoryItem():
9 void BrowseDirectoryItem::set_control(XinemaControlItem *c)
12 disconnect(&control->get_control(), 0, this, 0);
17 XinemaControl &xc = control->get_control();
18 connect(&xc, &XinemaControl::directory_started, this, &BrowseDirectoryItem::directory_started);
19 connect(&xc, &XinemaControl::file_added, this, &BrowseDirectoryItem::file_added);
20 connect(&xc, &XinemaControl::subdirectory_added, this, &BrowseDirectoryItem::subdirectory_added);
23 emit control_changed();
26 void BrowseDirectoryItem::set_directory(const QString &d)
33 control->get_control().list_directory(directory);
34 emit directory_changed();
37 void BrowseDirectoryItem::directory_started(const QString &dir)
42 emit directory_changed();
47 model.add_entry("..", DirectoryModel::ParentDir);
50 void BrowseDirectoryItem::file_added(const QString &name)
52 model.add_entry(name, DirectoryModel::File);
55 void BrowseDirectoryItem::subdirectory_added(const QString &name)
57 model.add_entry(name, DirectoryModel::SubDir);