diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-01-17 19:33:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-20 16:53:10 +0100 |
commit | a0d27513f4eff3f76fd85e6442aca443b7c05a53 (patch) | |
tree | 2239ed849796744299fbe25ab3cc50c2867160e9 /examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp | |
parent | 9ba631edb469599d3973982f8d5d72a9ba059eab (diff) |
whitespace fixes
remove trailing spaces & expand tabs
Change-Id: Ia088c8cc8a83d068f6e2ec84903b5220cd3411f1
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp')
-rw-r--r-- | examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp index bdf450eb..dd4a5546 100644 --- a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/directory.cpp @@ -48,10 +48,10 @@ Initialize the saves directory and creates the file list */ Directory::Directory(QObject *parent) : QObject(parent) { - + m_dir.cd( QDir::currentPath()); - + //go to the saved directory. if not found, create save directory m_saveDir = "saves"; if (m_dir.cd(m_saveDir) == 0){ @@ -144,7 +144,7 @@ void Directory::setFileContent(const QString &str){ if(str != m_fileContent){ m_fileContent = str; emit fileContentChanged(); - } + } } /* @@ -152,17 +152,17 @@ Called from QML to save the file using the filename and file content. Saving makes sure that the file has a .txt extension. */ void Directory::saveFile(){ - + if(currentFile.name().size() == 0){ qWarning()<< "Empty filename. no save"; return; } - + QString extendedName = currentFile.name(); if(!currentFile.name().endsWith(".txt")){ extendedName.append(".txt"); } - + QFile file( m_dir.filePath(extendedName) ); if (file.open(QFile::WriteOnly | QFile::Truncate)){ QTextStream outStream(&file); @@ -184,11 +184,11 @@ void Directory::loadFile(){ if(!currentFile.name().endsWith(".txt")){ extendedName.append(".txt"); } - + QFile file( m_dir.filePath(extendedName) ); if (file.open(QFile::ReadOnly )){ QTextStream inStream(&file); - + QString line; do{ line = inStream.read(75); @@ -205,12 +205,12 @@ created files are added onto the list. void Directory::refresh(){ m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name); m_fileList.clear(); - + File * file; for(int i = 0; i < m_dirFiles.size() ; i ++){ - + file = new File(); - + if(m_dirFiles.at(i).endsWith(".txt")){ QString name = m_dirFiles.at(i); file->setName( name.remove(".txt",Qt::CaseSensitive)); |