Change back _FindValidFileName to use BString, don't know what I was thinking, thanks Jerome and Stephan.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34141 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -169,7 +169,7 @@ ScreenshotWindow::MessageReceived(BMessage* message)
|
|||||||
case kImageOutputFormat:
|
case kImageOutputFormat:
|
||||||
message->FindInt32("be:type", &fImageFileType);
|
message->FindInt32("be:type", &fImageFileType);
|
||||||
message->FindInt32("be:translator", &fTranslator);
|
message->FindInt32("be:translator", &fTranslator);
|
||||||
fNameControl->SetText(_FindValidFileName(fNameControl->Text()));
|
fNameControl->SetText(_FindValidFileName(fNameControl->Text()).String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kLocationChanged:
|
case kLocationChanged:
|
||||||
@@ -178,7 +178,7 @@ ScreenshotWindow::MessageReceived(BMessage* message)
|
|||||||
if (message->FindPointer("source", &source) == B_OK)
|
if (message->FindPointer("source", &source) == B_OK)
|
||||||
fLastSelectedPath = static_cast<BMenuItem*> (source);
|
fLastSelectedPath = static_cast<BMenuItem*> (source);
|
||||||
|
|
||||||
fNameControl->SetText(_FindValidFileName(fNameControl->Text()));
|
fNameControl->SetText(_FindValidFileName(fNameControl->Text()).String());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ ScreenshotWindow::_SetupSecondLayoutItem(BCardLayout* layout)
|
|||||||
_SetupOutputPathMenu(new BMenu("Please select"), settings);
|
_SetupOutputPathMenu(new BMenu("Please select"), settings);
|
||||||
BMenuField* menuField2 = new BMenuField("Save in:", fOutputPathMenu);
|
BMenuField* menuField2 = new BMenuField("Save in:", fOutputPathMenu);
|
||||||
|
|
||||||
fNameControl->SetText(_FindValidFileName("screenshot1"));
|
fNameControl->SetText(_FindValidFileName("screenshot1").String());
|
||||||
|
|
||||||
_SetupTranslatorMenu(new BMenu("Please select"), settings);
|
_SetupTranslatorMenu(new BMenu("Please select"), settings);
|
||||||
BMenuField* menuField = new BMenuField("Save as:", fTranslatorMenu);
|
BMenuField* menuField = new BMenuField("Save as:", fTranslatorMenu);
|
||||||
@@ -557,7 +557,7 @@ ScreenshotWindow::_UpdatePreviewPanel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char*
|
BString
|
||||||
ScreenshotWindow::_FindValidFileName(const char* name)
|
ScreenshotWindow::_FindValidFileName(const char* name)
|
||||||
{
|
{
|
||||||
BString baseName(name);
|
BString baseName(name);
|
||||||
@@ -616,7 +616,7 @@ ScreenshotWindow::_FindValidFileName(const char* name)
|
|||||||
entry.SetTo(outputPath.Path());
|
entry.SetTo(outputPath.Path());
|
||||||
} while (entry.Exists());
|
} while (entry.Exists());
|
||||||
|
|
||||||
return BString(filename).String();
|
return BString(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ ScreenshotWindow::_SaveScreenshot()
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (fSaveScreenshotSilent)
|
if (fSaveScreenshotSilent)
|
||||||
path.Append(_FindValidFileName("screenshot1"));
|
path.Append(_FindValidFileName("screenshot1").String());
|
||||||
else
|
else
|
||||||
path.Append(fNameControl->Text());
|
path.Append(fNameControl->Text());
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ private:
|
|||||||
BString& label, int32 index, bool markItem);
|
BString& label, int32 index, bool markItem);
|
||||||
|
|
||||||
void _UpdatePreviewPanel();
|
void _UpdatePreviewPanel();
|
||||||
const char* _FindValidFileName(const char* name);
|
BString _FindValidFileName(const char* name);
|
||||||
int32 _PathIndexInMenu(const BString& path) const;
|
int32 _PathIndexInMenu(const BString& path) const;
|
||||||
|
|
||||||
BMessage _ReadSettings() const;
|
BMessage _ReadSettings() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user