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:
parent
b6fe353a0f
commit
a244529a4f
@ -6,15 +6,6 @@ SyncDocument::~SyncDocument()
|
||||
clearRedoStack();
|
||||
}
|
||||
|
||||
size_t SyncDocument::getTrackIndexFromPos(size_t track) const
|
||||
{
|
||||
return track;
|
||||
}
|
||||
|
||||
/* void SyncDocument::purgeUnusedTracks()
|
||||
{
|
||||
} */
|
||||
|
||||
#import <msxml4.dll> named_guids
|
||||
|
||||
bool SyncDocument::load(const std::string &fileName)
|
||||
|
||||
@ -265,9 +265,10 @@ public:
|
||||
return cmd;
|
||||
}
|
||||
|
||||
size_t getTrackIndexFromPos(size_t track) const;
|
||||
|
||||
/* void purgeUnused(); */
|
||||
size_t getTrackIndexFromPos(size_t track) const
|
||||
{
|
||||
return track;
|
||||
}
|
||||
|
||||
bool load(const std::string &fileName);
|
||||
bool save(const std::string &fileName);
|
||||
|
||||
@ -437,7 +437,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -8,17 +8,17 @@ using namespace sync;
|
||||
|
||||
Data::~Data()
|
||||
{
|
||||
for (size_t i = 0; i < actualTracks.size(); ++i)
|
||||
delete actualTracks[i];
|
||||
for (size_t i = 0; i < tracks.size(); ++i)
|
||||
delete tracks[i];
|
||||
}
|
||||
|
||||
size_t Data::createTrack(const std::basic_string<TCHAR> &name)
|
||||
{
|
||||
assert(0 > getTrackIndex(name));
|
||||
size_t index = actualTracks.size();
|
||||
size_t index = tracks.size();
|
||||
|
||||
// insert new track
|
||||
actualTracks.push_back(new sync::Track(name));
|
||||
tracks.push_back(new sync::Track(name));
|
||||
|
||||
return index;
|
||||
}
|
||||
@ -27,9 +27,9 @@ int Data::getTrackIndex(const std::basic_string<TCHAR> &name)
|
||||
{
|
||||
// search for track
|
||||
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
|
||||
|
||||
10
sync/data.h
10
sync/data.h
@ -36,18 +36,18 @@ namespace sync
|
||||
Track &
|
||||
getTrack(size_t track)
|
||||
{
|
||||
assert(track < actualTracks.size());
|
||||
assert(NULL != actualTracks[track]);
|
||||
return *actualTracks[track];
|
||||
assert(track < tracks.size());
|
||||
assert(NULL != tracks[track]);
|
||||
return *tracks[track];
|
||||
}
|
||||
|
||||
size_t
|
||||
getTrackCount() const
|
||||
{
|
||||
return actualTracks.size();
|
||||
return tracks.size();
|
||||
}
|
||||
|
||||
protected:
|
||||
std::vector<Track*> actualTracks;
|
||||
std::vector<Track*> tracks;
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user