MCPcopy Create free account
hub / github.com/davy7125/polyphone / removeRecentSoundfontFile

Method removeRecentSoundfontFile

sources/context/recentfilemanager.cpp:121–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void RecentFileManager::removeRecentSoundfontFile(QString filePath)
122{
123 filePath = filePath.replace("\\", "/");
124 int position = _listFiles.indexOf(filePath);
125 if (position != -1)
126 {
127 for (int i = position; i < MAX_SF2_FILES - 1; i++)
128 {
129 _listFiles[i] = _listFiles.at(i + 1);
130 _listDateTimes[i] = _listDateTimes.at(i + 1);
131 }
132 _listFiles[MAX_SF2_FILES - 1] = "";
133 _listDateTimes[0] = QDateTime::currentDateTime();
134
135 for (int i = 0; i < MAX_SF2_FILES; i++)
136 {
137 _configuration->setValue(ConfManager::SECTION_RECENT_FILES, "file_" + QString::number(i), _listFiles.at(i));
138 _configuration->setValue(ConfManager::SECTION_RECENT_FILES, "file_time_" + QString::number(i),
139 _listDateTimes.at(i).toString("yyyy/MM/dd HH:mm:ss"));
140 }
141 }
142
143 emit recentSf2Changed();
144}
145
146QString RecentFileManager::getLastFile(FileType fileType, int num)
147{

Callers 1

keyPressEventMethod · 0.80

Calls 4

replaceMethod · 0.80
indexOfMethod · 0.80
setValueMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected