[DEV] update to etk::FSNode

This commit is contained in:
Edouard DUPIN 2012-11-01 10:47:36 +01:00
parent eac1f8f594
commit 8fdeb39b5a
16 changed files with 93 additions and 90 deletions

View File

@ -51,7 +51,7 @@ Buffer::Buffer()
EWOL_DEBUG("Create buffer try name : \"" << mString << "\""); EWOL_DEBUG("Create buffer try name : \"" << mString << "\"");
SetFileName(mString); SetFileName(mString);
m_haveName = false; m_haveName = false;
EWOL_DEBUG("Create buffer with name : \"" << m_fileName.GetCompleateName() << "\""); EWOL_DEBUG("Create buffer with name : " << m_fileName );
} }
/** /**
@ -62,12 +62,12 @@ Buffer::Buffer()
* @return --- * @return ---
* *
*/ */
Buffer::Buffer(etk::File &newName) Buffer::Buffer(etk::FSNode &newName)
{ {
m_fileModify = false; m_fileModify = false;
EWOL_DEBUG("Create buffer try name : \"" << newName << "\""); EWOL_DEBUG("Create buffer try name : \"" << newName << "\"");
SetFileName(newName); SetFileName(newName);
EWOL_DEBUG("Create buffer with name : \"" << m_fileName.GetCompleateName() << "\""); EWOL_DEBUG("Create buffer with name : " << m_fileName );
} }
/** /**

View File

@ -27,7 +27,7 @@
#define __BUFFER_H__ #define __BUFFER_H__
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/os/File.h> #include <etk/os/FSNode.h>
#include <etk/unicode.h> #include <etk/unicode.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
@ -50,15 +50,15 @@ typedef struct{
class Buffer { class Buffer {
public: public:
Buffer(void); Buffer(void);
Buffer(etk::File &newName); Buffer(etk::FSNode &newName);
virtual ~Buffer(void); virtual ~Buffer(void);
etk::File GetFileName(void) etk::FSNode GetFileName(void)
{ {
return m_fileName; return m_fileName;
}; };
void SetFileName(etk::File &newName) void SetFileName(etk::FSNode &newName)
{ {
m_fileName = newName; m_fileName = newName;
m_haveName = true; m_haveName = true;
@ -67,7 +67,7 @@ class Buffer {
void SetFileName(etk::UString &newName) void SetFileName(etk::UString &newName)
{ {
m_fileName.SetCompleateName(newName, etk::FILE_TYPE_DIRECT); m_fileName.SetName(newName);
m_haveName = true; m_haveName = true;
NameChange(); NameChange();
}; };
@ -139,7 +139,7 @@ class Buffer {
protected: protected:
bool m_fileModify; //!< bool m_fileModify; //!<
// naming // naming
etk::File m_fileName; //!< filename of the curent buffer etk::FSNode m_fileName; //!< filename of the curent buffer
bool m_haveName; //!< to know if the file have a name or NOT bool m_haveName; //!< to know if the file have a name or NOT
}; };

View File

@ -63,15 +63,15 @@ class classBufferManager: public ewol::EObject
// create a buffer with no element // create a buffer with no element
int32_t Create(void); int32_t Create(void);
// open curent filename // open curent filename
int32_t Open(etk::File &myFile); int32_t Open(etk::FSNode &myFile);
bool Remove(int32_t BufferID); bool Remove(int32_t BufferID);
public: public:
int32_t GetSelected(void) { return m_idSelected;}; int32_t GetSelected(void) { return m_idSelected;};
//void SetSelected(int32_t id) {m_idSelected = id;}; //void SetSelected(int32_t id) {m_idSelected = id;};
Buffer * Get(int32_t BufferID); Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID); bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile); bool Exist(etk::FSNode &myFile);
int32_t GetId(etk::File &myFile); int32_t GetId(etk::FSNode &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void); uint32_t Size(void);
uint32_t SizeOpen(void); uint32_t SizeOpen(void);
@ -165,7 +165,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else if (eventId == ednMsgOpenFile) { } else if (eventId == ednMsgOpenFile) {
if (data != "" ) { if (data != "" ) {
etk::File myFile(data, etk::FILE_TYPE_DIRECT); etk::FSNode myFile(data);
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\""); APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\"");
int32_t newOne = Open(myFile); int32_t newOne = Open(myFile);
if (-1 != newOne) { if (-1 != newOne) {
@ -343,7 +343,7 @@ int32_t classBufferManager::Create(void)
* @todo : check if this file is not curently open and return the old ID * @todo : check if this file is not curently open and return the old ID
* *
*/ */
int32_t classBufferManager::Open(etk::File &myFile) int32_t classBufferManager::Open(etk::FSNode &myFile)
{ {
if (false == Exist(myFile)) { if (false == Exist(myFile)) {
// allocate a new Buffer // allocate a new Buffer
@ -396,7 +396,7 @@ bool classBufferManager::Exist(int32_t BufferID)
} }
bool classBufferManager::Exist(etk::File &myFile ) bool classBufferManager::Exist(etk::FSNode &myFile )
{ {
if (-1 == GetId(myFile)) { if (-1 == GetId(myFile)) {
return false; return false;
@ -405,7 +405,7 @@ bool classBufferManager::Exist(etk::File &myFile )
} }
int32_t classBufferManager::GetId(etk::File &myFile) int32_t classBufferManager::GetId(etk::FSNode &myFile)
{ {
int32_t iii; int32_t iii;
// check if the Buffer existed // check if the Buffer existed
@ -561,7 +561,7 @@ bool BufferManager::Exist(int32_t BufferID)
return localManager->Exist(BufferID); return localManager->Exist(BufferID);
} }
bool BufferManager::Exist(etk::File &myFile) bool BufferManager::Exist(etk::FSNode &myFile)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
@ -570,7 +570,7 @@ bool BufferManager::Exist(etk::File &myFile)
return localManager->Exist(myFile); return localManager->Exist(myFile);
} }
int32_t BufferManager::GetId(etk::File &myFile) int32_t BufferManager::GetId(etk::FSNode &myFile)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");

View File

@ -39,8 +39,8 @@ namespace BufferManager
int32_t GetSelected(void); int32_t GetSelected(void);
Buffer * Get(int32_t BufferID); Buffer * Get(int32_t BufferID);
bool Exist(int32_t BufferID); bool Exist(int32_t BufferID);
bool Exist(etk::File &myFile); bool Exist(etk::FSNode &myFile);
int32_t GetId(etk::File &myFile); int32_t GetId(etk::FSNode &myFile);
// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5
uint32_t Size(void); uint32_t Size(void);
uint32_t SizeOpen(void); uint32_t SizeOpen(void);

View File

@ -117,20 +117,22 @@ BufferText::BufferText()
* @return --- * @return ---
* *
*/ */
BufferText::BufferText(etk::File &fileName) : Buffer(fileName) BufferText::BufferText(etk::FSNode &fileName) : Buffer(fileName)
{ {
BasicInit(); BasicInit();
NameChange(); NameChange();
APPL_INFO("Add Data from file(" << GetFileName() << ")"); APPL_INFO("Add Data from file(" << GetFileName() << ")");
FILE * myFile = NULL; etk::FSNode myFile(fileName);
// try to open the file. if not existed, new file if (true == myFile.Exist()) {
if (false == myFile.FileOpenRead()) {
myFile = fopen(fileName.GetCompleateName().c_str(), "r"); APPL_WARNING("File can not be open in read mode : " << myFile);
if (NULL != myFile) { SetModify(true);
m_EdnBuf.DumpFrom(myFile); } else {
// close the input file // TODO : Old methode to file access :
fclose(myFile); //m_EdnBuf.DumpFrom(myFile);
SetModify(false); myFile.FileClose();
SetModify(false);
}
} else { } else {
// fichier inexistant... creation d'un nouveaux // fichier inexistant... creation d'un nouveaux
APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")"); APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")");
@ -151,14 +153,14 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
void BufferText::Save(void) void BufferText::Save(void)
{ {
APPL_INFO("Save File : \"" << GetFileName() << "\"" ); APPL_INFO("Save File : \"" << GetFileName() << "\"" );
FILE * myFile = NULL; etk::FSNode myFile(GetFileName());
myFile = fopen(GetFileName().GetCompleateName().c_str(), "w"); if (false == myFile.FileOpenWrite()) {
if (NULL != myFile) {
m_EdnBuf.DumpIn(myFile);
fclose(myFile);
SetModify(false);
} else {
APPL_ERROR("Can not open in writing the specify file"); APPL_ERROR("Can not open in writing the specify file");
} else {
// TODO : Old methode to file access :
//m_EdnBuf.DumpIn(myFile);
myFile.FileClose();
SetModify(false);
} }
} }

View File

@ -48,7 +48,7 @@ class CharElement
class BufferText : public Buffer { class BufferText : public Buffer {
public: public:
BufferText(void); BufferText(void);
BufferText(etk::File &fileName); BufferText(etk::FSNode &fileName);
virtual ~BufferText(void); virtual ~BufferText(void);
void Save(void); void Save(void);

View File

@ -28,6 +28,7 @@
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
#include <ewol/eObject/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h> #include <ewol/eObject/EObjectManager.h>
#include <etk/os/FSNode.h>
#define PFX "ColorizeManager " #define PFX "ColorizeManager "
@ -143,17 +144,17 @@ void classColorManager::LoadFile(const char * xmlFilename)
// allocate the document in the stack // allocate the document in the stack
TiXmlDocument XmlDocument; TiXmlDocument XmlDocument;
// open the curent File // open the curent File
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.FileSize();
if (0==fileSize) { if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
@ -165,9 +166,9 @@ void classColorManager::LoadFile(const char * xmlFilename)
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file : // load data from the file :
fileName.fRead(fileBuffer, 1, fileSize); fileName.FileRead(fileBuffer, 1, fileSize);
// close the file: // close the file:
fileName.fClose(); fileName.FileClose();
// load the XML from the memory // load the XML from the memory
XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8); XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);

View File

@ -46,7 +46,7 @@ static void SortElementList(etk::Vector<appl::dataBufferStruct *> &list)
for(int32_t jjj=0; jjj<list.Size(); jjj++) { for(int32_t jjj=0; jjj<list.Size(); jjj++) {
//EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\""); //EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\"");
if (list[jjj]!=NULL) { if (list[jjj]!=NULL) {
if (tmpList[iii]->m_bufferName.GetShortFilename() > list[jjj]->m_bufferName.GetShortFilename()) { if (tmpList[iii]->m_bufferName.GetNameFile() > list[jjj]->m_bufferName.GetNameFile()) {
findPos = jjj+1; findPos = jjj+1;
} }
} }
@ -103,7 +103,7 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
for (int32_t iii=0; iii<nbBufferOpen; iii++) { for (int32_t iii=0; iii<nbBufferOpen; iii++) {
if (BufferManager::Exist(iii)) { if (BufferManager::Exist(iii)) {
bool isModify = BufferManager::Get(iii)->IsModify(); bool isModify = BufferManager::Get(iii)->IsModify();
etk::File name = BufferManager::Get(iii)->GetFileName(); etk::FSNode name = BufferManager::Get(iii)->GetFileName();
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify); appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
if (NULL != tmpElement) { if (NULL != tmpElement) {
m_list.PushBack(tmpElement); m_list.PushBack(tmpElement);
@ -164,7 +164,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
if( raw>=0 if( raw>=0
&& raw<m_list.Size() && raw<m_list.Size()
&& NULL != m_list[raw]) { && NULL != m_list[raw]) {
myTextToWrite = m_list[raw]->m_bufferName.GetShortFilename(); myTextToWrite = m_list[raw]->m_bufferName.GetNameFile();
if (true == m_list[raw]->m_isModify) { if (true == m_list[raw]->m_isModify) {
selectFG = COLOR_LIST_TEXT_MODIFY; selectFG = COLOR_LIST_TEXT_MODIFY;

View File

@ -36,10 +36,10 @@ namespace appl
class dataBufferStruct class dataBufferStruct
{ {
public: public:
etk::File m_bufferName; etk::FSNode m_bufferName;
uint32_t m_bufferID; uint32_t m_bufferID;
bool m_isModify; bool m_isModify;
dataBufferStruct(etk::File& bufferName, int32_t bufferID, bool isModify) : dataBufferStruct(etk::FSNode& bufferName, int32_t bufferID, bool isModify) :
m_bufferName(bufferName), m_bufferName(bufferName),
m_bufferID(bufferID), m_bufferID(bufferID),
m_isModify(isModify) m_isModify(isModify)

View File

@ -302,8 +302,8 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
if (BufferManager::GetSelected()!=-1) { if (BufferManager::GetSelected()!=-1) {
Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected()); Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL!=myBuffer) { if (NULL!=myBuffer) {
etk::File tmpFile = myBuffer->GetFileName(); etk::FSNode tmpFile = myBuffer->GetFileName();
tmpWidget->SetFolder(tmpFile.GetFolder()); tmpWidget->SetFolder(tmpFile.GetNameFolder());
} }
} }
PopUpWidgetPush(tmpWidget); PopUpWidgetPush(tmpWidget);
@ -335,9 +335,9 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
etk::UString folder = "/home/"; etk::UString folder = "/home/";
etk::UString fileName = ""; etk::UString fileName = "";
if (true == myBuffer->HaveName()) { if (true == myBuffer->HaveName()) {
etk::File tmpName = myBuffer->GetFileName(); etk::FSNode tmpName = myBuffer->GetFileName();
folder = tmpName.GetFolder(); folder = tmpName.GetNameFolder();
fileName = tmpName.GetShortFilename(); fileName = tmpName.GetNameFile();
} }
tmpWidget->SetFolder(folder); tmpWidget->SetFolder(folder);
tmpWidget->SetFileName(fileName); tmpWidget->SetFileName(fileName);
@ -358,9 +358,9 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
// the buffer change we need to update the widget string // the buffer change we need to update the widget string
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected()); Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) { if (NULL != tmpBuffer) {
etk::File compleateName = tmpBuffer->GetFileName(); etk::FSNode compleateName = tmpBuffer->GetFileName();
bool isModify = tmpBuffer->IsModify(); bool isModify = tmpBuffer->IsModify();
etk::UString directName = compleateName.GetCompleateName(); etk::UString directName = compleateName.GetName();
if (true == isModify) { if (true == isModify) {
directName += " *"; directName += " *";
} }

View File

@ -49,17 +49,17 @@ Highlight::Highlight(etk::UString &xmlFilename)
{ {
TiXmlDocument XmlDocument; TiXmlDocument XmlDocument;
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
APPL_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.FileSize();
if (0==fileSize) { if (0==fileSize) {
APPL_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.FileOpenRead()) {
APPL_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
@ -71,9 +71,9 @@ Highlight::Highlight(etk::UString &xmlFilename)
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
// load data from the file : // load data from the file :
fileName.fRead(fileBuffer, 1, fileSize); fileName.FileRead(fileBuffer, 1, fileSize);
// close the file: // close the file:
fileName.fClose(); fileName.FileClose();
// load the XML from the memory // load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8); bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) { if (false == loadError) {
@ -191,15 +191,15 @@ bool Highlight::HasExtention(etk::UString &ext)
return false; return false;
} }
bool Highlight::FileNameCompatible(etk::File &fileName) bool Highlight::FileNameCompatible(etk::FSNode &fileName)
{ {
int32_t i; int32_t i;
etk::UString extention; etk::UString extention;
if (true == fileName.HasExtention() ) { if (true == fileName.FileHasExtention() ) {
extention = "*."; extention = "*.";
extention += fileName.GetExtention(); extention += fileName.FileGetExtention();
} else { } else {
extention = fileName.GetShortFilename(); extention = fileName.GetNameFile();
} }
APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" "); APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");

View File

@ -42,7 +42,7 @@ extern "C" {
} colorInformation_ts; } colorInformation_ts;
} }
#include <etk/os/File.h> #include <etk/os/FSNode.h>
#include <HighlightPattern.h> #include <HighlightPattern.h>
#include <Colorize.h> #include <Colorize.h>
#include <EdnVectorBuf.h> #include <EdnVectorBuf.h>
@ -54,7 +54,7 @@ class Highlight {
Highlight(etk::UString &xmlFilename); Highlight(etk::UString &xmlFilename);
~Highlight(void); ~Highlight(void);
bool HasExtention(etk::UString &ext); bool HasExtention(etk::UString &ext);
bool FileNameCompatible(etk::File &fileName); bool FileNameCompatible(etk::FSNode &fileName);
void Display(void); void Display(void);
void ReloadColor(void); void ReloadColor(void);
void Parse(int32_t start, void Parse(int32_t start,

View File

@ -89,7 +89,7 @@ class localClassHighlightManager: public ewol::EObject
*/ */
} }
Highlight* Get(etk::File &fileName) Highlight* Get(etk::FSNode &fileName)
{ {
int32_t i; int32_t i;
for (i=0; i<listHighlight.Size(); i++) { for (i=0; i<listHighlight.Size(); i++) {
@ -100,7 +100,7 @@ class localClassHighlightManager: public ewol::EObject
return NULL; return NULL;
} }
bool Exist(etk::File &fileName) bool Exist(etk::FSNode &fileName)
{ {
if (NULL != Get(fileName) ) { if (NULL != Get(fileName) ) {
return true; return true;
@ -201,7 +201,7 @@ void HighlightManager::loadLanguages(void)
localManager->loadLanguages(); localManager->loadLanguages();
} }
Highlight* HighlightManager::Get(etk::File &fileName) Highlight* HighlightManager::Get(etk::FSNode &fileName)
{ {
if (NULL == localManager) { if (NULL == localManager) {
return NULL; return NULL;
@ -209,7 +209,7 @@ Highlight* HighlightManager::Get(etk::File &fileName)
return localManager->Get(fileName); return localManager->Get(fileName);
} }
bool HighlightManager::Exist(etk::File &fileName) bool HighlightManager::Exist(etk::FSNode &fileName)
{ {
if (NULL == localManager) { if (NULL == localManager) {
return false; return false;

View File

@ -36,8 +36,8 @@ namespace HighlightManager{
void Init(void); void Init(void);
void UnInit(void); void UnInit(void);
void loadLanguages(void); void loadLanguages(void);
Highlight* Get(etk::File &fileName); Highlight* Get(etk::FSNode &fileName);
bool Exist(etk::File &fileName); bool Exist(etk::FSNode &fileName);
}; };

View File

@ -31,7 +31,7 @@
#include <ewol/widget/meta/FileChooser.h> #include <ewol/widget/meta/FileChooser.h>
#include <appl/Gui/TagFileSelection.h> #include <appl/Gui/TagFileSelection.h>
// TODO : The line ID is no more stored in the file system (FSNode) ...
#undef __class__ #undef __class__
#define __class__ "CTagsManager" #define __class__ "CTagsManager"
@ -73,7 +73,7 @@ class CTagsManager: public ewol::EObject
tagFile * m_ctagFile; tagFile * m_ctagFile;
// history system // history system
int32_t m_historyPos; int32_t m_historyPos;
etk::Vector<etk::File*> m_historyList; etk::Vector<etk::FSNode*> m_historyList;
void RegisterHistory(void); void RegisterHistory(void);
}; };
@ -151,9 +151,9 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
} else if( eventId == ednEventPopUpCtagsLoadFile } else if( eventId == ednEventPopUpCtagsLoadFile
|| eventId == ednMsgCtagsLoadFile) { || eventId == ednMsgCtagsLoadFile) {
// open the new one : // open the new one :
etk::File tmpFilename = data; etk::FSNode tmpFilename = data;
m_tagFilename = tmpFilename.GetShortFilename(); m_tagFilename = tmpFilename.GetNameFile();
m_tagFolderBase = tmpFilename.GetFolder(); m_tagFolderBase = tmpFilename.GetNameFolder();
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " "); APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
LoadTagFile(); LoadTagFile();
} else if (eventId == ednMsgGuiCtags) { } else if (eventId == ednMsgGuiCtags) {
@ -176,8 +176,8 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
} else if (data == "Back") { } else if (data == "Back") {
if (m_historyList.Size() > 0) { if (m_historyList.Size() > 0) {
int32_t id = m_historyList.Size()-1; int32_t id = m_historyList.Size()-1;
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetCompleateName() ); SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
SendMultiCast(ednMsgGuiGotoLine, m_historyList[id]->GetLineNumber()); SendMultiCast(ednMsgGuiGotoLine, 0);// TODO : m_historyList[id]->GetLineNumber());
// Remove element .... // Remove element ....
delete(m_historyList[id]); delete(m_historyList[id]);
m_historyList[id]=NULL; m_historyList[id]=NULL;
@ -229,9 +229,9 @@ void CTagsManager::RegisterHistory(void)
int32_t currentSelected = BufferManager::GetSelected(); int32_t currentSelected = BufferManager::GetSelected();
Buffer* tmpBuf = BufferManager::Get(currentSelected); Buffer* tmpBuf = BufferManager::Get(currentSelected);
if (NULL != tmpBuf) { if (NULL != tmpBuf) {
etk::File * bufferFilename = new etk::File(); etk::FSNode * bufferFilename = new etk::FSNode();
*bufferFilename = tmpBuf->GetFileName(); *bufferFilename = tmpBuf->GetFileName();
bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine()); // TODO : bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
m_historyList.PushBack(bufferFilename); m_historyList.PushBack(bufferFilename);
} }
} }
@ -254,7 +254,7 @@ void CTagsManager::JumpTo(void)
// For all tags : Save in an internal Structure : // For all tags : Save in an internal Structure :
etk::UString tmpFile(m_tagFolderBase + "/" + entry.file); etk::UString tmpFile(m_tagFolderBase + "/" + entry.file);
etk::File myfile(tmpFile); etk::FSNode myfile(tmpFile);
int32_t lineID = entry.address.lineNumber; int32_t lineID = entry.address.lineNumber;
PrintTag(&entry, true); PrintTag(&entry, true);
@ -264,13 +264,13 @@ void CTagsManager::JumpTo(void)
if (NULL == tmpWidget) { if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error"); APPL_ERROR("Can not allocate widget ==> display might be in error");
} else { } else {
tmpWidget->AddCtagsNewItem(myfile.GetCompleateName(), lineID); tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
do { do {
tmpFile = m_tagFolderBase + "/" + entry.file; tmpFile = m_tagFolderBase + "/" + entry.file;
myfile = tmpFile; myfile = tmpFile;
lineID = entry.address.lineNumber; lineID = entry.address.lineNumber;
PrintTag(&entry, true); PrintTag(&entry, true);
tmpWidget->AddCtagsNewItem(myfile.GetCompleateName(), lineID); tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess); } while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
PopUpWidgetPush(tmpWidget); PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, applEventctagsSelection); tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
@ -278,7 +278,7 @@ void CTagsManager::JumpTo(void)
} else { } else {
RegisterHistory(); RegisterHistory();
APPL_INFO(" OPEN the TAG file Destination : " << tmpFile ); APPL_INFO(" OPEN the TAG file Destination : " << tmpFile );
SendMultiCast(ednMsgOpenFile, myfile.GetCompleateName()); SendMultiCast(ednMsgOpenFile, myfile.GetName());
SendMultiCast(ednMsgGuiGotoLine, lineID - 1); SendMultiCast(ednMsgGuiGotoLine, lineID - 1);
} }
} else { } else {

View File

@ -31,7 +31,7 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <etk/os/File.h> #include <etk/os/FSNode.h>
#include <etk/tool.h> #include <etk/tool.h>
#include <Gui/MainWindows.h> #include <Gui/MainWindows.h>
#include <BufferManager.h> #include <BufferManager.h>
@ -154,9 +154,9 @@ void APP_Init(void)
} }
etk::File APP_Icon(void) etk::FSNode APP_Icon(void)
{ {
etk::File bitmapFile("iconEdn.bmp", etk::FILE_TYPE_DATA); etk::FSNode bitmapFile("DATA:iconEdn.bmp");
return bitmapFile; return bitmapFile;
} }