12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. |
13 * GNU General Public License for more details. |
14 * |
14 * |
15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 * ===================================================================== |
|
18 * |
|
19 * file.cpp: File I/O and management. |
|
20 * - File loading, parsing, manipulation, saving, closing. |
|
21 * - LDraw path verification. |
17 */ |
22 */ |
18 |
23 |
19 #include <QMessageBox> |
24 #include <QMessageBox> |
20 #include <QFileDialog> |
25 #include <QFileDialog> |
21 #include <QDir> |
26 #include <QDir> |
22 #include <QApplication> |
27 #include <QApplication> |
23 |
|
24 #include <stdlib.h> |
|
25 #include "common.h" |
28 #include "common.h" |
26 #include "config.h" |
29 #include "config.h" |
27 #include "file.h" |
30 #include "file.h" |
28 #include "misc.h" |
31 #include "misc.h" |
29 #include "gui.h" |
32 #include "gui.h" |
147 |
150 |
148 // ============================================================================= |
151 // ============================================================================= |
149 // ----------------------------------------------------------------------------- |
152 // ----------------------------------------------------------------------------- |
150 LDFile* findLoadedFile (str name) { |
153 LDFile* findLoadedFile (str name) { |
151 for (LDFile* file : g_loadedFiles) |
154 for (LDFile* file : g_loadedFiles) |
152 if (file->name() == name) |
155 if (!file->name().isEmpty() && file->getShortName() == name) |
153 return file; |
156 return file; |
154 |
157 |
155 return null; |
158 return null; |
156 } |
159 } |
157 |
160 |