From a2b5bda5d17a13499da401e25e53b8b62ba16c20 Mon Sep 17 00:00:00 2001
From: Gabriel Maia <gbl08ma@gmail.com>
Date: Tue, 6 Sep 2016 16:16:18 +0000
Subject: [PATCH] Screenshot: create destination folder if it doesn't exist
This ensures the artwork folder is created if it doesn't exist,
fixing the remainder of #10928.
---
src/apps/screenshot/ScreenshotWindow.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp
index ec70bdf..205cd81 100644
a
|
b
|
ScreenshotWindow::_SaveScreenshot()
|
619 | 619 | if (path == NULL) |
620 | 620 | return B_ERROR; |
621 | 621 | |
| 622 | BEntry direntry; |
| 623 | direntry.SetTo(path.Path()); |
| 624 | |
| 625 | // create folder if it doesn't exist |
| 626 | // necessary, for example, when the user selects the Artwork folder from |
| 627 | // the list of predefined folders. |
| 628 | if (!direntry.Exists()) { |
| 629 | BDirectory directory; |
| 630 | if (directory.CreateDirectory(path.Path(), NULL) != B_OK) { |
| 631 | return B_ERROR; |
| 632 | } |
| 633 | } |
| 634 | |
622 | 635 | path.Append(fNameControl->Text()); |
623 | 636 | |
624 | 637 | BEntry entry; |