Skip to content

Commit dd64646

Browse files
committed
rename openFileDialog
1 parent fd5df0c commit dd64646

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

linux/src/file_dialog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <gtk/gtk.h>
33
#include <cstring>
44

5-
std::vector<std::string> openFileDialog(const std::string &title, const std::string &defaultDir, const std::vector<std::string> &filterExtensions) {
5+
std::vector<std::string> open_file_dialog(const std::string &title, const std::string &defaultDir, const std::vector<std::string> &filterExtensions) {
66
std::vector<std::string> result;
77

88
// Initialize GTK if not already initialized

linux/src/file_dialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#include <vector>
55
#include <string>
66

7-
std::vector<std::string> openFileDialog(const std::string &title, const std::string &defaultDir, const std::vector<std::string> &filterExtensions);
7+
std::vector<std::string> open_file_dialog(const std::string &title, const std::string &defaultDir, const std::vector<std::string> &filterExtensions);
88

99
#endif

macos/src/file_dialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#include <string>
55
#include <vector>
66

7-
std::vector<std::string>openFileDialog(char const * const aTitle, char const * const aDefaultPathAndFile, const std::vector<std::string> & filters);
7+
std::vector<std::string>open_file_dialog(char const * const aTitle, char const * const aDefaultPathAndFile, const std::vector<std::string> & filters);
88

99
#endif

macos/src/file_dialog.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string>
55
#include <vector>
66

7-
std::vector<std::string>openFileDialog(
7+
std::vector<std::string>open_file_dialog(
88
char const * const aTitle ,
99
char const * const aDefaultPathAndFile ,
1010
const std::vector<std::string> & filters) {

shared/chip8.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int chip8_load_rom(const char *rom_filepath) {
193193
} else {
194194
/* load ROM from GUI */
195195
char new_rom_name[PATH_MAX];
196-
openFileDialog(new_rom_name) ?
196+
open_file_dialog(new_rom_name) ?
197197
printf("User aborted the open file dialog.\n") :
198198
chip8_load_rom(new_rom_name);
199199

shared/open_file_dialog.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
#endif
1818

1919
/* Returns 0 on success, 1 on error (or user hit cancel) */
20-
int openFileDialog(char *rom_name) {
20+
int open_file_dialog(char *rom_name) {
2121

2222
#if defined(__APPLE__) || defined(__linux__)
2323
// Common flow for Apple and Linux: both return a vector<string>
2424
std::vector<std::string> fileTypes = {"ch8", "CH8", "chip-8", "CHIP-8", "Chip-8"};
2525
const char* defaultDir = ""; // unify behavior: let OS choose last-used/home
26-
std::vector<std::string> files = openFileDialog("Chip8", defaultDir, fileTypes);
26+
std::vector<std::string> files = open_file_dialog("Chip8", defaultDir, fileTypes);
2727
if (files.empty()) return 1;
2828
snprintf(rom_name, 256, "%s", files[0].c_str());
2929
return 0;
3030

3131
#elif defined(_WIN32)
3232
// Windows API variant writes directly into buffer and returns int
33-
return openFileDialog(rom_name, "Chip8\0*.ch8\0All\0*.*\0");
33+
return open_file_dialog(rom_name, "Chip8\0*.ch8\0All\0*.*\0");
3434

3535
#else
3636
return 1;

shared/open_file_dialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
#include <limits.h> /* PATH_MAX */
1515
#endif
1616

17-
int openFileDialog(char *rom_name);
17+
int open_file_dialog(char *rom_name);
1818

1919
#endif

windows/src/file_dialog.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <stdlib.h>
55
#include <string.h>
66

7-
int openFileDialog(char *rom_name, char *filters) {
7+
int open_file_dialog(char *rom_name, char *filters) {
88
/* open file dialogue */
99
char cwd[MAX_PATH];
1010
GetCurrentDirectory(MAX_PATH, cwd);
@@ -34,7 +34,7 @@ int openFileDialog(char *rom_name, char *filters) {
3434
/* user hit cancel */
3535
return 1;
3636
}
37-
37+
3838
strcpy(rom_name, szFile);
3939
return 0;
40-
}
40+
}

windows/src/file_dialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef WIN32_FILE_DIALOG_H
22
#define WIN32_FILE_DIALOG_H
33

4-
int openFileDialog(char *rom_name, char *filters);
4+
int open_file_dialog(char *rom_name, char *filters);
55

66
#endif

0 commit comments

Comments
 (0)