~openhommdev/openhomm/gui

« back to all changes in this revision

Viewing changes to src/core/hrSndEngine.cpp

  • Committer: Stanislav Ershov
  • Date: 2010-02-09 01:48:58 UTC
  • Revision ID: digital.stream.of.mind@gmail.com-20100209014858-j4hxtrebjdtblo9n
refactored and documented some code

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
void hrSndEngine::setFileName(const QString &file)
38
38
{
39
 
    int c = file.count('/');
 
39
    _archivename = hrFilesystem::extractArchnameFromPath(file, ".lod");
 
40
    _filename    = hrFilesystem::extractFilenameFromPath(file, ".lod");
40
41
 
41
 
    if ( file.endsWith(".snd", Qt::CaseInsensitive) )
42
 
    {
43
 
        _archivename = file.section('/', 1, c);
44
 
        _filename = "";
45
 
    }
46
 
    else
47
 
    {
48
 
        _archivename = file.section('/', c-(c-1), c-1);
49
 
        _filename = file.section('/', c, c).toLower();
50
 
    }
 
42
    _filename = _filename.toLower();
51
43
}
52
44
 
53
45
bool hrSndEngine::open(QIODevice::OpenMode flags)