Skip to content

Commit 1a8f0e2

Browse files
committed
[RMV] : Removal of old drives stuff
1 parent 92c7ef3 commit 1a8f0e2

2 files changed

Lines changed: 3 additions & 36 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,6 @@ SOFTWARE.
190190
#ifndef resetButtonString
191191
#define resetButtonString "R"
192192
#endif // resetButtonString
193-
#ifndef drivesButtonString
194-
#define drivesButtonString "Drives"
195-
#endif // drivesButtonString
196193
#ifndef editPathButtonString
197194
#define editPathButtonString "E"
198195
#endif // editPathButtonString
@@ -217,9 +214,6 @@ SOFTWARE.
217214
#ifndef buttonResetSearchString
218215
#define buttonResetSearchString "Reset search"
219216
#endif // buttonResetSearchString
220-
#ifndef buttonDriveString
221-
#define buttonDriveString "Drives"
222-
#endif // buttonDriveString
223217
#ifndef buttonEditPathString
224218
#define buttonEditPathString "Edit path\nYou can also right click on path buttons"
225219
#endif // buttonEditPathString
@@ -1685,7 +1679,6 @@ IGFD::FileManager::FileManager() {
16851679
}
16861680

16871681
void IGFD::FileManager::OpenCurrentPath(const FileDialogInternal& vFileDialogInternal) {
1688-
showDrives = false;
16891682
ClearComposer();
16901683
ClearFileLists();
16911684
if (dLGDirectoryMode) { // directory mode
@@ -2013,7 +2006,6 @@ bool IGFD::FileManager::GetDrives() {
20132006
m_FileList.push_back(info);
20142007
}
20152008
}
2016-
showDrives = true;
20172009
return true;
20182010
}
20192011
return false;
@@ -2300,24 +2292,15 @@ bool IGFD::FileManager::SelectDirectory(const std::shared_ptr<FileInfos>& vInfos
23002292
} else {
23012293
std::string newPath;
23022294

2303-
if (showDrives) {
2304-
newPath = vInfos->fileNameExt + IGFD::Utils::GetPathSeparator();
2305-
} else {
23062295
#ifdef __linux__
23072296
if (fsRoot == m_CurrentPath)
23082297
newPath = m_CurrentPath + vInfos->fileNameExt;
23092298
else
23102299
#endif // __linux__
23112300
newPath = m_CurrentPath + IGFD::Utils::GetPathSeparator() + vInfos->fileNameExt;
2312-
}
23132301

23142302
if (m_FileSystemPtr->IsDirectoryCanBeOpened(newPath)) {
2315-
if (showDrives) {
2316-
m_CurrentPath = vInfos->fileNameExt;
2317-
fsRoot = m_CurrentPath;
2318-
} else {
2319-
m_CurrentPath = newPath; //-V820
2320-
}
2303+
m_CurrentPath = newPath; //-V820
23212304
pathClick = true;
23222305
}
23232306
}
@@ -2639,12 +2622,6 @@ void IGFD::FileDialogInternal::EndFrame() {
26392622
fileManager.OpenCurrentPath(*this);
26402623
}
26412624

2642-
if (fileManager.drivesClicked) {
2643-
if (fileManager.GetDrives()) {
2644-
fileManager.ApplyFilteringOnFileList(*this);
2645-
}
2646-
}
2647-
26482625
if (fileManager.inputPathActivated) {
26492626
auto gio = ImGui::GetIO();
26502627
if (ImGui::IsKeyReleased(ImGuiKey_Enter)) {
@@ -3001,7 +2978,7 @@ void IGFD::PlacesFeature::m_InitPlaces(FileDialogInternal& vFileDialogInternal)
30012978
if (devices_ptr != nullptr && vFileDialogInternal.fileManager.GetFileSystemInstance() != nullptr) {
30022979
const auto& devices = vFileDialogInternal.fileManager.GetFileSystemInstance()->GetDevicesList();
30032980
IGFD::FileStyle style;
3004-
style.icon = ICON_IGFD_DRIVES;
2981+
style.icon = PLACE_DEVICES_ICON;
30052982
for (const auto& device : devices) {
30062983
devices_ptr->AddPlace(device.first + " " + device.second, device.first, false, style);
30072984
}
@@ -3360,15 +3337,6 @@ void IGFD::KeyExplorerFeature::m_ExploreWithkeys(FileDialogInternal& vFileDialog
33603337
m_LocateFileByInputChar_lastFileIdx = 0;
33613338
}
33623339
}
3363-
#ifdef _IGFD_WIN_
3364-
else {
3365-
if (fdi.GetComposerSize() == 1U) {
3366-
if (fdi.GetDrives()) {
3367-
fdi.ApplyFilteringOnFileList(vFileDialogInternal);
3368-
}
3369-
}
3370-
}
3371-
#endif // _IGFD_WIN_
33723340
}
33733341
}
33743342
}
@@ -3656,7 +3624,7 @@ bool IGFD::FileDialog::Display(const std::string& vKey, ImGuiWindowFlags vFlags,
36563624
fdFilter.SetDefaultFilterIfNotDefined();
36573625

36583626
// init list of files
3659-
if (fdFile.IsFileListEmpty() && !fdFile.showDrives) {
3627+
if (fdFile.IsFileListEmpty()) {
36603628
if (fdFile.dLGpath != ".") // Removes extension seperator in filename if we don't check
36613629
IGFD::Utils::ReplaceString(fdFile.dLGDefaultFileName, fdFile.dLGpath, ""); // local path
36623630

ImGuiFileDialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,6 @@ class IGFD_API FileManager {
17981798
defaultSortOrderFilename, defaultSortOrderType, defaultSortOrderSize, defaultSortOrderDate};
17991799
#endif
18001800
SortingFieldEnum sortingField = SortingFieldEnum::FIELD_FILENAME; // detail view sorting column
1801-
bool showDrives = false; // drives are shown (only on os windows)
18021801

18031802
std::string dLGpath; // base path set by user when OpenDialog was called
18041803
std::string dLGDefaultFileName; // base default file path name set by user when OpenDialog was called

0 commit comments

Comments
 (0)