[qet] [2021] Added hasFilePath() and filePath() methods to TitleBlockTemplatesCollection and its derived classes.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2021
Author:   xavier
Date:     2013-02-03 20:21:13 +0100 (Sun, 03 Feb 2013)
Log Message:
-----------
Added hasFilePath() and filePath() methods to TitleBlockTemplatesCollection and its derived classes.

Modified Paths:
--------------
    trunk/sources/titleblock/templatescollection.cpp
    trunk/sources/titleblock/templatescollection.h

Modified: trunk/sources/titleblock/templatescollection.cpp
===================================================================
--- trunk/sources/titleblock/templatescollection.cpp	2013-02-03 12:02:05 UTC (rev 2020)
+++ trunk/sources/titleblock/templatescollection.cpp	2013-02-03 19:21:13 UTC (rev 2021)
@@ -270,6 +270,22 @@
 }
 
 /**
+	@return always false since a project collection is not stored on any
+	filesystem.
+*/
+bool TitleBlockTemplatesProjectCollection::hasFilePath() {
+	return(false);
+}
+
+/**
+	@return always an empty string since a project collection is not stored on
+	any filesystem.
+*/
+QString TitleBlockTemplatesProjectCollection::filePath() {
+	return(QString());
+}
+
+/**
 	@param template_name Either an empty QString to know whether the collection
 	itself is read only, or a specific template name.
 	@return true if the specified template is read only, false otherwise
@@ -454,6 +470,21 @@
 }
 
 /**
+	@return always true since a files collection is always stored on a
+	filesystem.
+*/
+bool TitleBlockTemplatesFilesCollection::hasFilePath() {
+	return(true);
+}
+
+/**
+	@return The filesystem path where this files collection is actually stored.
+*/
+QString TitleBlockTemplatesFilesCollection::filePath() {
+	return(dir_.canonicalPath());
+}
+
+/**
 	@param template_name Either an empty QString to know whether the collection
 	itself is read only, or a specific template name.
 	@return true if the specified template is read only, false otherwise

Modified: trunk/sources/titleblock/templatescollection.h
===================================================================
--- trunk/sources/titleblock/templatescollection.h	2013-02-03 12:02:05 UTC (rev 2020)
+++ trunk/sources/titleblock/templatescollection.h	2013-02-03 19:21:13 UTC (rev 2021)
@@ -48,6 +48,8 @@
 	virtual bool setTemplateXmlDescription(const QString &, const QDomElement &) = 0;
 	virtual void removeTemplate(const QString &) = 0;
 	virtual TitleBlockTemplateLocation location(const QString & = QString()) = 0;
+	virtual bool hasFilePath() = 0;
+	virtual QString filePath() = 0;
 	virtual bool isReadOnly(const QString & = QString()) const = 0;
 	virtual QString title() const;
 	virtual void setTitle(const QString &);
@@ -95,6 +97,8 @@
 	virtual bool setTemplateXmlDescription(const QString &, const QDomElement &);
 	virtual void removeTemplate(const QString &);
 	virtual TitleBlockTemplateLocation location(const QString & = QString());
+	virtual bool hasFilePath();
+	virtual QString filePath();
 	virtual bool isReadOnly(const QString & = QString()) const;
 	virtual void fromXml(const QDomElement &);
 	virtual void deleteUnusedTitleBlocKTemplates();
@@ -132,6 +136,8 @@
 	virtual bool setTemplateXmlDescription(const QString &, const QDomElement &);
 	virtual void removeTemplate(const QString &);
 	virtual TitleBlockTemplateLocation location(const QString & = QString());
+	virtual bool hasFilePath();
+	virtual QString filePath();
 	virtual bool isReadOnly(const QString & = QString()) const;
 	
 	static QString toTemplateName(const QString &);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/