Commit 8841e7fd authored by Matthias Möller's avatar Matthias Möller

- using QFileInfo to seperate filename and path

- updated doc

refs #670

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14530 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1d9d49bc
......@@ -58,6 +58,7 @@
#include "Types.hh"
#include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <QFileInfo>
//== TYPEDEFS =================================================================
......@@ -713,9 +714,9 @@ QStringList BaseObject::getGroupNames() {
// ===============================================================================
void BaseObjectData::setFromFileName(QString _filename ) {
QString str = _filename;
path_ = str.section(QDir::separator() ,0,-2);
setName(str.section(QDir::separator(),-1));
QFileInfo file_info(_filename);
path_ = file_info.path();
setName(file_info.fileName());
}
void BaseObjectData::setName( QString _name ) {
......
......@@ -434,10 +434,10 @@ class DLLEXPORTONLY BaseObject : public QObject {
/// set the path to the object.
void setPath(QString _path);
/// return the name of the object. The name defaults to NONAME if unset.
/// return the filename of the object. The name defaults to NONAME if unset.
QString name( );
/// set the name of the object. ( If you overwrite it, call BaseObject::setName(_name ) it in your funtion first)
/// set the filename of the object. ( If you overwrite it, call BaseObject::setName(_name ) it in your funtion first)
virtual void setName( QString _name );
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment