Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4QtBaseWidgets/TGo4QFileItem.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4QFileItem.h"
00017 #include "qfileinfo.h"
00018 #include "qpixmap.h"
00019 #include "TFile.h"
00020 
00021 TGo4QFileItem::TGo4QFileItem( QListView* parent, const QString & text, QFileInfo fi, TFile * file)
00022    :TGo4QItem (parent, "rootdb_t", text)
00023 {
00024     char buffer[10];
00025     snprintf(buffer,9,"%d",fi.size());
00026     QString Size= buffer;
00027     QString comment="unknown";
00028     if(file) comment= file->GetTitle();
00029     setText(1,"Root File");
00030     setText(2,comment);
00031     setText(3,Size);
00032     setText(4,fi.lastModified().toString());
00033     setText(5,fi.owner());
00034     setText(6,fi.group());
00035     IsActive=FALSE;
00036     HasComp=FALSE;
00037     SetRootFile(file);
00038 }
00039 
00040 TGo4QFileItem::TGo4QFileItem( QListView* parent, const QString & text, TFile * file)
00041    :TGo4QItem (parent, "rootdb_t", text)
00042 {
00043     QString Size= "";
00044     QString comment="unknown";
00045     if(file) comment= file->GetTitle();
00046     setText(1,"Root File");
00047     setText(2,comment);
00048     setText(3,Size);
00049     setText(4,"");
00050     setText(5,"");
00051     setText(6,"");
00052     IsActive=FALSE;
00053     HasComp=FALSE;
00054     SetRootFile(file);
00055 }
00056 
00057 void TGo4QFileItem::SetAsActiveFile(bool stat)
00058 {
00059    if(stat){
00060       IsActive=true;
00061    }else{
00062       IsActive=false;
00063    }
00064 }
00065 
00066 bool  TGo4QFileItem::IsActiveFile()
00067 {
00068    return IsActive;
00069 }
00070 TGo4QFileItem::~TGo4QFileItem(){}
00071 
00072 void TGo4QFileItem::Close()
00073 {
00074    if(fxRootFile!=0){
00075       //fxRootFile->Close(); // Close() will not delete rest of TFile object
00076       delete fxRootFile; // closes and frees mem
00077       fxRootFile=0;
00078    }
00079 }
00080 
00081 
00082 
00083 
00084 
00085 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:04 2005 for Go4-v2.10-5 by doxygen1.2.15