Renamed actualTracks to tracks, removed dead code (the out-commented empty function purgeUnused), replaced "Error" with NULL (This gives a localized error-string) for MessageBox in one place.

This commit is contained in:
Erik Faye-Lund 2008-09-27 15:55:20 +00:00
parent b6fe353a0f
commit a244529a4f
5 changed files with 16 additions and 24 deletions

View File

@ -6,15 +6,6 @@ SyncDocument::~SyncDocument()
clearRedoStack(); clearRedoStack();
} }
size_t SyncDocument::getTrackIndexFromPos(size_t track) const
{
return track;
}
/* void SyncDocument::purgeUnusedTracks()
{
} */
#import <msxml4.dll> named_guids #import <msxml4.dll> named_guids
bool SyncDocument::load(const std::string &fileName) bool SyncDocument::load(const std::string &fileName)

View File

@ -265,9 +265,10 @@ public:
return cmd; return cmd;
} }
size_t getTrackIndexFromPos(size_t track) const; size_t getTrackIndexFromPos(size_t track) const
{
/* void purgeUnused(); */ return track;
}
bool load(const std::string &fileName); bool load(const std::string &fileName);
bool save(const std::string &fileName); bool save(const std::string &fileName);

View File

@ -437,7 +437,7 @@ int _tmain(int argc, _TCHAR* argv[])
if (NULL == hwnd) if (NULL == hwnd)
{ {
MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"), MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); MessageBox(NULL, _T("Window Creation Failed!"), NULL, MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND);
return -1; return -1;
} }

View File

@ -8,17 +8,17 @@ using namespace sync;
Data::~Data() Data::~Data()
{ {
for (size_t i = 0; i < actualTracks.size(); ++i) for (size_t i = 0; i < tracks.size(); ++i)
delete actualTracks[i]; delete tracks[i];
} }
size_t Data::createTrack(const std::basic_string<TCHAR> &name) size_t Data::createTrack(const std::basic_string<TCHAR> &name)
{ {
assert(0 > getTrackIndex(name)); assert(0 > getTrackIndex(name));
size_t index = actualTracks.size(); size_t index = tracks.size();
// insert new track // insert new track
actualTracks.push_back(new sync::Track(name)); tracks.push_back(new sync::Track(name));
return index; return index;
} }
@ -27,9 +27,9 @@ int Data::getTrackIndex(const std::basic_string<TCHAR> &name)
{ {
// search for track // search for track
size_t index; size_t index;
for (index = 0; index < actualTracks.size(); ++index) for (index = 0; index < tracks.size(); ++index)
{ {
if (name == actualTracks[index]->getName()) return int(index); if (name == tracks[index]->getName()) return int(index);
} }
// not found // not found

View File

@ -36,18 +36,18 @@ namespace sync
Track & Track &
getTrack(size_t track) getTrack(size_t track)
{ {
assert(track < actualTracks.size()); assert(track < tracks.size());
assert(NULL != actualTracks[track]); assert(NULL != tracks[track]);
return *actualTracks[track]; return *tracks[track];
} }
size_t size_t
getTrackCount() const getTrackCount() const
{ {
return actualTracks.size(); return tracks.size();
} }
protected: protected:
std::vector<Track*> actualTracks; std::vector<Track*> tracks;
}; };
} }