Commit [r69] Maximize Restore History

List item extension

andrew_golovnia 2014-02-13

removed /trunk/gui/src/YDListItem.h
changed /trunk/cmd/src/YDCmdApplication.h
changed /trunk/cmd/src/YDConfigFile.h
changed /trunk/cmd/src/YDWorkThread.h
changed /trunk/gui/gui.pro
changed /trunk/gui/gui.vcxproj
changed /trunk/gui/gui.vcxproj.filters
changed /trunk/gui/src/GuiVersion.h
changed /trunk/gui/src/YDAbstractListItem.h
changed /trunk/gui/src/YDGuiApplication.h
changed /trunk/gui/src/YDListDelegate.h
changed /trunk/gui/src/YDListModel.h
changed /trunk/gui/src/YDListView.h
changed /trunk/inc/Version.h
copied /trunk/gui/src/YDAbstractListItem.h -> /trunk/gui/src/YDDiskListItem.h
copied /trunk/gui/src/YDListItem.cpp -> /trunk/gui/src/YDDiskListItem.cpp
/trunk/gui/src/YDListItem.h
File was removed.
/trunk/cmd/src/YDCmdApplication.h Diff Switch to side-by-side view
Loading...
/trunk/cmd/src/YDConfigFile.h Diff Switch to side-by-side view
Loading...
/trunk/cmd/src/YDWorkThread.h Diff Switch to side-by-side view
Loading...
/trunk/gui/gui.pro Diff Switch to side-by-side view
Loading...
/trunk/gui/gui.vcxproj Diff Switch to side-by-side view
Loading...
/trunk/gui/gui.vcxproj.filters Diff Switch to side-by-side view
Loading...
/trunk/gui/src/GuiVersion.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDAbstractListItem.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDGuiApplication.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDListDelegate.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDListModel.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDListView.h Diff Switch to side-by-side view
Loading...
/trunk/inc/Version.h Diff Switch to side-by-side view
Loading...
/trunk/gui/src/YDListItem.cpp to /trunk/gui/src/YDDiskListItem.cpp
--- a/trunk/gui/src/YDListItem.cpp
+++ b/trunk/gui/src/YDDiskListItem.cpp
@@ -1,34 +1,137 @@
-/*!	\file YDListItem.cpp
-	\brief YDListItem source file.
+/*!	\file YDDiskListItem.cpp
+	\brief YDDiskListItem source file.
 	\author Andriy Golovnya <andriy.golovnya@gmail.com> http://ag.embedded.org.ru/
 	\url http://yourdefrag.sf.net/ http://sf.net/projects/yourdefrag/
 	\license GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
 
-#include <signal.h>
+#include "YDDiskListItem.h"
 
-#include <QDebug>
+#define UNUSED(expr) do { (void)(expr); } while (0)
 
-#include "YDListItem.h"
+/*!	\class YDDiskListItem
+	\brief Disk list item class.
 
-/*!	\class YDListItem
-	\brief List item class.
-
-	This class handles basic behavior of list item.
+	This class handles basic behavior of disk list item.
 */
 
 /*!	\todo add class members and methods documentation here.
 */
 
-/*!	\brief List item class constructor.
+YDDiskListItem::YDDiskListItem():
+	m_thread(NULL),
+	m_diskLabel(QString::null),
+	m_enabled(true),
+	m_extended(false) {
+}
 
-	This function prepares list item for furder use.
-*/
-YDListItem::YDListItem(
-	const QString &name			/*!<[in] Disk name. */
-): 	m_name(name),
-	m_progress(0),
-	m_enabled(false),
-	m_extended(false),
-	m_hasUpdate(false) {
+YDDiskListItem::YDDiskListItem(YDWorkThread *thread):
+	m_thread(thread),
+	m_diskLabel(QString::null),
+	m_enabled(true),
+	m_extended(false) {
 }
+
+YDDiskListItem::~YDDiskListItem(
+) {
+
+	if(m_thread)
+		delete m_thread;
+}
+
+QString YDDiskListItem::name(
+) const {
+
+	if(m_thread)
+		return m_thread->diskName();
+	else
+		return QString::null;
+}
+
+void YDDiskListItem::setName(
+	const QString& name
+) {
+	UNUSED(name);
+}
+
+QString YDDiskListItem::info(
+) const {
+	return QString::null;	/*! \todo redo? */
+}
+
+void YDDiskListItem::setInfo(
+	const QString& info
+) {
+	UNUSED(info);
+}
+
+QString YDDiskListItem::progress(
+) const {
+	return 50;	/*! \todo redo? */
+}
+
+void YDDiskListItem::setProgress(
+	const int progress
+) {
+	UNUSED(progress);
+}
+
+QString YDDiskListItem::status(
+) const {
+	return QString::null;	/*! \todo redo? */
+}
+
+void YDDiskListItem::setStatus(
+	const QString& status
+) {
+	UNUSED(status);
+}
+
+QImage YDDiskListItem::icon(
+) const {
+	return m_icon;
+}
+
+void YDDiskListItem::setIcon(
+	const QImage& icon
+) {
+	UNUSED(icon);
+}
+
+QImage YDDiskListItem::map(
+) const {
+	return m_map;
+}
+
+void YDDiskListItem::setMap(
+	const QImage& map
+) {
+	UNUSED(map);
+}
+
+bool YDDiskListItem::enabled(
+) const {
+	return m_enabled;
+}
+
+void YDDiskListItem::setEnabled(
+	const bool enabled
+) {
+	UNUSED(enabled);
+}
+
+bool YDDiskListItem::extended(
+) const {
+	return m_extended;
+}
+
+void YDDiskListItem::setExtended(
+	const bool extended
+) {
+	UNUSED(extended);
+}
+
+void YDDiskListItem::setHasUpdate(
+	const bool hasUpdate
+) {
+}