[haiku-commits] r34141 - haiku/trunk/src/apps/screenshot

  • From: fredrik@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 19 Nov 2009 22:51:36 +0100 (CET)

Author: modeenf
Date: 2009-11-19 22:51:36 +0100 (Thu, 19 Nov 2009)
New Revision: 34141
Changeset: http://dev.haiku-os.org/changeset/34141/haiku

Modified:
   haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp
   haiku/trunk/src/apps/screenshot/ScreenshotWindow.h
Log:
Change back _FindValidFileName to use BString, don't know what I was thinking, 
thanks Jerome and Stephan.

Modified: haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp
===================================================================
--- haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp        2009-11-19 
20:47:17 UTC (rev 34140)
+++ haiku/trunk/src/apps/screenshot/ScreenshotWindow.cpp        2009-11-19 
21:51:36 UTC (rev 34141)
@@ -169,7 +169,7 @@
                case kImageOutputFormat:
                        message->FindInt32("be:type", &fImageFileType);
                        message->FindInt32("be:translator", &fTranslator);
-                       
fNameControl->SetText(_FindValidFileName(fNameControl->Text()));
+                       
fNameControl->SetText(_FindValidFileName(fNameControl->Text()).String());
                        break;
                
                case kLocationChanged:
@@ -178,7 +178,7 @@
                        if (message->FindPointer("source", &source) == B_OK)
                                fLastSelectedPath = static_cast<BMenuItem*> 
(source);
 
-                       
fNameControl->SetText(_FindValidFileName(fNameControl->Text()));
+                       
fNameControl->SetText(_FindValidFileName(fNameControl->Text()).String());
                        break;
                }
                
@@ -377,7 +377,7 @@
        _SetupOutputPathMenu(new BMenu("Please select"), settings);
        BMenuField* menuField2 = new BMenuField("Save in:", fOutputPathMenu);
        
-       fNameControl->SetText(_FindValidFileName("screenshot1"));
+       fNameControl->SetText(_FindValidFileName("screenshot1").String());
 
        _SetupTranslatorMenu(new BMenu("Please select"), settings);
        BMenuField* menuField = new BMenuField("Save as:", fTranslatorMenu);
@@ -557,7 +557,7 @@
 }
 
 
-const char*
+BString
 ScreenshotWindow::_FindValidFileName(const char* name)
 {
        BString baseName(name);
@@ -616,7 +616,7 @@
                entry.SetTo(outputPath.Path());
        } while (entry.Exists());
 
-       return BString(filename).String();
+       return BString(filename);
 }
 
 
@@ -772,7 +772,7 @@
                return B_ERROR;
 
        if (fSaveScreenshotSilent)      
-               path.Append(_FindValidFileName("screenshot1"));
+               path.Append(_FindValidFileName("screenshot1").String());
        else
                path.Append(fNameControl->Text());
        

Modified: haiku/trunk/src/apps/screenshot/ScreenshotWindow.h
===================================================================
--- haiku/trunk/src/apps/screenshot/ScreenshotWindow.h  2009-11-19 20:47:17 UTC 
(rev 34140)
+++ haiku/trunk/src/apps/screenshot/ScreenshotWindow.h  2009-11-19 21:51:36 UTC 
(rev 34141)
@@ -56,7 +56,7 @@
                                                                BString& label, 
int32 index, bool markItem);
 
                        void                    _UpdatePreviewPanel();
-       const   char*                   _FindValidFileName(const char* name);
+                       BString                 _FindValidFileName(const char* 
name);
                        int32                   _PathIndexInMenu(const BString& 
path) const;
 
                        BMessage                _ReadSettings() const;


Other related posts:

  • » [haiku-commits] r34141 - haiku/trunk/src/apps/screenshot - fredrik