--- /dev/null
+This is the README for st.
--- /dev/null
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+ return a.exec();
+}
--- /dev/null
+#include "mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+}
+
+MainWindow::~MainWindow()
+{
+
+}
--- /dev/null
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+private:
+ QListView *sessionView;
+};
+
+#endif // MAINWINDOW_H
--- /dev/null
+# -------------------------------------------------
+# Project created by QtCreator 2011-07-26T16:09:06
+# -------------------------------------------------
+QT += xml \
+ xmlpatterns
+TARGET = st
+TEMPLATE = app
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ tasklist.cpp
+HEADERS += mainwindow.h \
+ tasklist.h
+OTHER_FILES += README.txt
--- /dev/null
+#include "tasklist.h"
+
+Task::Task(QDomElement &root)
+{
+ QDomElement titleElement = root.firstChildElement("title");
+ _title = titleElement.text();
+
+ QDomElement length = titleElement.nextSibling();
+ QDomElement hours = length.firstChild("hours");
+
+ int hour = hours.text().toInt();
+
+ QDomElement minutes = hours.nextSibling();
+
+ int minute = minutes.text().toInt();
+
+ _taskLength = QTime(hour, minute, 0);
+
+ /* Fixme : implement remaining */
+}
+
+TaskList::TaskList()
+{
+}
+
+QVariant TaskList::data ( const QModelIndex & index, int role) const
+{
+ /*
+ if (!index.isValid())
+ return QVariant();
+ if (index.row() >= machineList.size() || index.row() < 0)
+ return QVariant();
+
+ if (role == Qt::DisplayRole)
+ return machineList.at(index.row());
+
+ return QVariant();
+ */
+ return QVariant();
+}
+
+int TaskList::rowCount (const QModelIndex & parent) const
+{
+ return 2;
+}
--- /dev/null
+#ifndef TASKLIST_H
+#define TASKLIST_H
+
+#include <QtCore>
+#include <QtXml>
+#include <QAbstractListModel>
+
+class Task
+{
+ /** this class models a task, which is a portion of a session */
+ Q_OBJECT
+ QString _title;
+ QTime _taskLength;
+ QTime _timeRemaining;
+
+public:
+ Task(QString title, QTime taskLength) : _title(title), _taskLength(taskLength), _timeRemaining() { };
+ Task(QDomElement& root);
+ QString title(void) { return _title; };
+ QTime taskLength(void) { return _taskLength; }
+
+};
+
+class TaskList : QAbstractListModel
+{
+ /** TaskList is our model class. It loads and saves tasks from an xml file.
+ Format of the xml file :
+ <session>
+ <task>
+ <title>Task 1</title>
+ <length>
+ <hours>3</hours>
+ <minutes>5</minutes>
+ </length>
+ <elasped>
+ <hours>3</hours>
+ <minutes>5</minutes>
+ </elapsed>
+ </task>
+ <task>
+ ...
+ </session>
+ */
+
+public:
+ TaskList();
+ TaskList(QFile& f);
+ QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
+ int rowCount (const QModelIndex & parent = QModelIndex() ) const;
+
+};
+
+#endif // TASKLIST_H