Commit f373c679 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Simplify file loading



There is no need to keep a redundant copy of the file name.

Change-Id: I407b1e4b92232a5869eade4d52eb7b4468fffa9d
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 60ead888
......@@ -185,9 +185,6 @@ public:
int totalWeight;
double progress;
double previousProgress;
// file to load
QString fileName;
};
......@@ -400,20 +397,9 @@ void QmlProfilerModelManager::save(const QString &filename)
void QmlProfilerModelManager::load(const QString &filename)
{
d->fileName = filename;
load();
}
void QmlProfilerModelManager::setFilename(const QString &filename)
{
d->fileName = filename;
}
void QmlProfilerModelManager::load()
{
QFile *file = new QFile(d->fileName, this);
QFile *file = new QFile(filename, this);
if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) {
emit error(tr("Could not open %1 for reading.").arg(d->fileName));
emit error(tr("Could not open %1 for reading.").arg(filename));
delete file;
emit loadFinished();
return;
......
......@@ -160,8 +160,6 @@ public slots:
void save(const QString &filename);
void load(const QString &filename);
void setFilename(const QString &filename);
void load();
private:
void setState(QmlProfilerDataState::State state);
......
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