From 72d9237817c2b5fa8b681564824edce3211e978d Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 29 Jul 2008 07:47:16 +0000 Subject: [PATCH] Add new FileName::set() method. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25954 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/FileName.cpp | 14 ++++++++++---- src/support/FileName.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 3c61eeaab9..6b3ac68e71 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -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(); diff --git a/src/support/FileName.h b/src/support/FileName.h index 9a8659054f..af35575286 100644 --- a/src/support/FileName.h +++ b/src/support/FileName.h @@ -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; -- 2.39.5