Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
40 user(s) are online (23 user(s) are browsing Forums)

Members: 1
Guests: 39

trixie, more...

Support us!

Headlines

Report message:*
 

Re: Porting to AmigaOS4 thread

Subject: Re: Porting to AmigaOS4 thread
by Raziel on 2020/11/22 11:49:45

@jabirulo

Thank you very much

I now get only one more warning

C++      backends/dialogs/amigaos/amigaos-dialogs.o
backends
/dialogs/amigaos/amigaos-dialogs.cppIn member function 'virtual Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const Common::U32String&, Common::FSNode&, bool)':
backends/dialogs/amigaos/amigaos-dialogs.cpp:111:56warningcast from type 'const value_type*' {aka 'const char*'to type 'char*' casts away qualifiers [-Wcast-qual]
   
char *newTitle utf8ToLocal((char *)utf8Title.c_str());
                                                        ^


- i get a working exe with an asl requester opening
- closing the requester works too, but

after closing the requester once i can not open another instances

Can you spot the mistake?

struct Library *AslBase IExec->OpenLibrary(AslName50);
struct AslIFace *IAsl;

Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const Common::U32String &titleCommon::FSNode &choicebool isDirBrowser) {

    
char pathBuffer[MAXPATHLEN];
    
Common::String utf8Title title.encode();    
    
DialogResult result kDialogCancel;

    if (
AslBase) {

        
IAsl = (struct AslIFace*)IExec->GetInterface(AslBase"main"1NULL);

        
struct FileRequester *fr NULL;

        if (
ConfMan.hasKey("browser_lastpath")) {
            
strncpy(pathBufferConfMan.get("browser_lastpath").c_str(), sizeof(pathBuffer)-1);
        }

        
fr = (struct FileRequester *)IAsl->AllocAslRequestTags(ASL_FileRequestTAG_DONE);

        if (!
fr)
            return 
result;

        
char *newTitle utf8ToLocal((char *)utf8Title.c_str());

        if (
IAsl->AslRequestTags(frASLFR_TitleTextnewTitleASLFR_RejectIconsTRUEASLFR_InitialDrawerpathBufferASLFR_DrawersOnly, (isDirBrowser TRUE FALSE), TAG_DONE)) {

            if (
strlen(fr->fr_Drawer) < sizeof(pathBuffer)) {
                
strncpy(pathBufferfr->fr_Drawersizeof(pathBuffer));
                if (!
isDirBrowser) {
                    
IDOS->AddPart(pathBufferfr->fr_Filesizeof(pathBuffer));
                }
                
choice Common::FSNode(pathBuffer);
                
ConfMan.set("browser_lastpath"pathBuffer);
                
result kDialogOk;
            }
            
free(newTitle);
            
IAsl->FreeAslRequest((APTR)fr);
        }
        
IExec->DropInterface((struct Interface*)IAsl);
        
IAsl NULL;
        
IExec->CloseLibrary(AslBase); 
        
AslBase NULL;
    }

    return 
result;
}


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project