Index: trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1170)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1172)
@@ -280,6 +280,4 @@
                    main?main:gClient->GetRoot(), w, h)
 {
-    fInputFile[0] = '\0';
-
     fList = new MGList;
     fList->SetOwner();
@@ -382,5 +380,5 @@
     // Checks if there is a selected input root file
     //
-    return fInputFile[0]!='\0';
+    return !fInputFile.IsNull(); //[0]!='\0';
 }
 
@@ -417,43 +415,21 @@
 }
 
-void MBrowser::SetFileName(const char *name)
-{
-    //
-    // determine the file type by extensions
-    //
-    const char *ext=strrchr(name, '.');
-
-    Bool_t failed = kFALSE;
-
-    if (!ext)
-        failed = kTRUE;
-    else
-        if (strcasecmp(ext, ".root"))
-            failed = kTRUE;
-
-    char *fname=NULL;
-    if (!failed)
+void MBrowser::SetFileName(TString name)
+{
+    if (name[0]!='/')
     {
-        const char *dir = fFileCont->GetDirectory();
-
-        fname = Form("%s/%s", dir, name);
-
-        failed = gSystem->AccessPathName(fname, kFileExists);
+        name.Insert(0, "/");
+        name.Insert(0, fFileCont->GetDirectory());
     }
 
-    if (!failed)
-        strcpy(fInputFile, fname);
-    else
-        fname = Form(fInputFile);
-
-    char *slash = strrchr(fname, '/');
-
-    fEntry->SetText(slash ? slash+1 : "");
-
-    if (!slash)
+    if (gSystem->AccessPathName(name, kFileExists))
         return;
 
-    *slash = '\0';
-    ChangeDir(fname);
+    if (name.EndsWith(".root", TString::kIgnoreCase))
+        fInputFile = name;
+
+    fEntry->SetText(gSystem->BaseName(name));
+
+    ChangeDir(gSystem->DirName(name));
 }
 
@@ -483,23 +459,19 @@
     const TGTextLBEntry *selected = (TGTextLBEntry*)filter->GetListBox()->GetSelectedEntry();
 
-    const char *txt = StrDup(selected->GetText()->GetString());
-
     //
     // find filter and remove leading spaces
     //
-    char *lt = strchr(txt, '<');
-    if (lt)
-    {
-        do *lt-- = '\0';
-        while (lt>txt && *lt==' ');
-
-        //
-        // Set new filter and refresh the file container
-        //
-        fFileCont->SetFilter(txt);
-        fFileCont->DisplayDirectory();
-    }
-
-    delete [] txt;
+    TString txt = selected->GetText()->GetString();
+    if (txt.First('<') < 0)
+        return;
+
+    //
+    // Set new filter and refresh the file container
+    //
+    txt.Remove(txt.First('<'));
+
+    TString ftxt = txt.Strip();
+    fFileCont->SetFilter(ftxt);
+    fFileCont->DisplayDirectory();
 }
 
Index: trunk/MagicSoft/Mars/mmain/MBrowser.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 1170)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 1172)
@@ -36,5 +36,5 @@
     void CreateDirListBox(TGCompositeFrame *frame);
 
-    void SetFileName(const char *name);
+    void SetFileName(TString name);
 
     void SetFilter();
@@ -44,5 +44,5 @@
 protected:
     MGList *fList;
-    Char_t  fInputFile[256];
+    TString fInputFile;
 
     TGCompositeFrame *CreateNewTab(const char *name);
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 1170)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 1172)
@@ -97,5 +97,5 @@
 //  histograms.
 //
-void MDataCheck::ViewAdcSpectra(Char_t *inputfile, Char_t *treeName)
+void MDataCheck::ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName)
 {
     //
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 1170)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 1172)
@@ -9,5 +9,5 @@
 {
 private:
-    void ViewAdcSpectra(Char_t *inputfile, Char_t *treeName);
+    void ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName);
 
 public:
