Commit e03b3307 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Remove hard-coded URL.

parent ee0d0013
......@@ -19,27 +19,28 @@
#include "QGraphicsObject"
#include "skymap.h"
#include "kstandarddirs.h"
WIView::WIView ( QObject *parent, ObsConditions *obs) : QObject(parent)
{
m = new ModelManager(obs);
QDeclarativeView *baseView;
baseView = new QDeclarativeView();
QDeclarativeView *baseView = new QDeclarativeView();
ctxt = baseView->rootContext();
ctxt->setContextProperty("catListModel", QVariant::fromValue(m->returnCatListModel( ModelManager::BaseList )));
baseView->setSource(QUrl("/home/sam/kstars/kstars/tools/WhatsInteresting/Base.qml"));
baseView->setSource(KStandardDirs::locate("appdata","tools/WhatsInteresting/Base.qml") );
baseObj = dynamic_cast<QObject *> (baseView->rootObject());
soTypeTextObj = baseObj->findChild<QObject *>("soTypeTextObj") ;
catListObj = baseObj->findChild<QObject *>("container")->findChild<QObject *>("catListObj");
catListObj = baseObj->findChild<QObject *>("catListObj");
connect(catListObj, SIGNAL(catListItemClicked(QString)), this, SLOT(onCatListItemClicked(QString)));
soListObj = baseObj->findChild<QObject *>("container")->findChild<QObject *>("soListObj");
soListObj = baseObj->findChild<QObject *>("soListObj");
connect(soListObj, SIGNAL(soListItemClicked(QString, int)),
this, SLOT(onSoListItemClicked(QString, int)));
detailsViewObj = baseObj->findChild<QObject *>("container")->findChild<QObject *>("detailsViewObj");
detailsViewObj = baseObj->findChild<QObject *>("detailsViewObj");
nextObj = baseObj->findChild<QObject *>("nextObj");
connect(nextObj, SIGNAL(nextObjTextClicked()), this, SLOT(onNextObjTextClicked()));
......@@ -167,4 +168,4 @@ void WIView::onNextObjTextClicked()
int modelSize = m->returnModel(curSoItem->getType())->rowCount();
SkyObjItem *nextItem = m->returnModel(curSoItem->getType())->getSkyObjItem((curIndex+1)%modelSize);
loadDetailsView(nextItem, (curIndex+1)%modelSize);
}
\ No newline at end of file
}
......@@ -29,7 +29,6 @@ class WIView : public QObject
public:
WIView(QObject *parent = 0, ObsConditions *obs = 0);
~WIView();
void manageViews(int TYPE); //display view
void loadDetailsView( SkyObjItem* soitem, int index);
public slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment