]> git.lyx.org Git - features.git/commitdiff
Add new FileName::set() method.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 29 Jul 2008 07:47:16 +0000 (07:47 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 29 Jul 2008 07:47:16 +0000 (07:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25954 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/FileName.cpp
src/support/FileName.h

index 3c61eeaab910ca8d3c648b01ffe53b8e940836d5..6b3ac68e7186f3a31a49933b0cce3dd43feeb1e1 100644 (file)
@@ -144,10 +144,7 @@ FileName::FileName(FileName const & rhs) : d(new Private)
 
 FileName::FileName(FileName const & rhs, string const & suffix) : d(new Private)
 {
-       if (!rhs.d->fi.isDir())
-               d->fi.setFile(rhs.d->fi.filePath() + toqstr(suffix));
-       else
-               d->fi.setFile(QDir(rhs.d->fi.absoluteFilePath()), toqstr(suffix));
+       set(rhs, suffix);
 }
 
 
@@ -182,6 +179,15 @@ void FileName::set(string const & name)
 }
 
 
+void FileName::set(FileName const & rhs, string const & suffix)
+{
+       if (!rhs.d->fi.isDir())
+               d->fi.setFile(rhs.d->fi.filePath() + toqstr(suffix));
+       else
+               d->fi.setFile(QDir(rhs.d->fi.absoluteFilePath()), toqstr(suffix));
+}
+
+
 void FileName::erase()
 {
        d->fi = QFileInfo();
index 9a8659054f2abe702bbefecb1a8ec86244cd5a0e..af35575286786212c78dd9142a7da367420beb50 100644 (file)
@@ -55,6 +55,7 @@ public:
         * Encoding is always UTF-8.
         */
        virtual void set(std::string const & filename);
+       virtual void set(FileName const & fn, std::string const & suffix);
        virtual void erase();
        /// Is this filename empty?
        bool empty() const;