27 #include "../../../../core/translator/Translator.h" 28 #include "../../../../dataaccess/datasource/DataSource.h" 29 #include "../../../../dataaccess/datasource/DataSourceManager.h" 30 #include "../../Exception.h" 53 if(role == Qt::DecorationRole)
57 if(ds ==
nullptr || !ds->isOpened())
58 return QVariant(QIcon::fromTheme(
"closed-datasource"));
60 return QVariant(QIcon::fromTheme(
"datasource"));
63 if(role == Qt::DisplayRole)
64 return QVariant(QString::fromUtf8(
m_ds->getTitle().c_str()));
71 QMenu* m =
new QMenu(parent);
73 QAction* aOpenDataSource = m->addAction(tr(
"&Open data source"));
75 connect(aOpenDataSource, SIGNAL(triggered()),
this, SLOT(openDataSource()));
82 if(
m_ds.get() ==
nullptr)
85 if(!children().empty())
93 return Qt::NoItemFlags;
98 if(
m_ds.get() ==
nullptr)
boost::shared_ptr< DataSource > DataSourcePtr
static te::dt::Date ds(2010, 01, 01)
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
A class that represents a data source in a DataSourceTreeModel.
A class used to group a set of dataset items in a DataSourceTreeModel.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr