This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Plugin interface descriptions for TC 7.55 (beta)
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8040
Location: Russian Federation

PostPosted: Fri Mar 02, 2012 12:17 pm    Post subject: Reply with quote

I doubt it will break anything. Adding Unicode requires a lot of changes anyway (all character types and strings should be converted, and Unicode strings should be called instead of old ANSI ones), so it won't be hard to add a pair of const's to code (if needed - and compiler will show all theese places, so no harm at all). As I said, no one should modify strings that I've marked as const - theese are read-only (input) strings, so there won't be any changes in logic. But it will simplify coding and improve code quality (it is a good rule to mark read-only parameters as const).

Nevertheless, as you wish.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8040
Location: Russian Federation

PostPosted: Tue May 15, 2012 12:40 am    Post subject: Reply with quote

Christian, please add #ifndef ... #endif preprocessor checks for header files to prevent redefinitions in case of multiple includes (which often occur in projects with multiple include files):

For WcxHead.h:
Code:
#pragma once
#ifndef _WCHHEAD_H_
#define _WCHHEAD_H_


/* Contents of file wcxhead.h */
/* It contains definitions of error codes, flags and callbacks */

...
/* the rest of old wcxhead.h */


#endif // #ifndef _WCHHEAD_H_



Similar should be applied to other 3 header files (#ifndef _CONTPLUG_H_ for ContPlug.h, #ifndef _FSPLUGIN_H_ for FsPlugin.h and #ifndef _LISTPLUG_H_ for ListPlug.h). It is absolutely safe and won't break anything.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35767
Location: Switzerland

PostPosted: Wed May 16, 2012 8:42 am    Post subject: Reply with quote

Hmm, I have never had this problem - when does this occur?
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8040
Location: Russian Federation

PostPosted: Wed May 16, 2012 9:22 am    Post subject: Reply with quote

It is a usual problem of header files, that's why such pragma exists and all standard headers contain such #ifndef.

E.g. try to compile Multiarc plugin:

multiarc.h, ArchiverManager.h:
Code:
...
#include "wcxhead.h"
...


multiarc.cpp:
Code:
...
#include "ArchiverManager.h"
...
#include "multiarc.h"
...


When compiler sees second definitions of same types (both multiarc.h and ArchiverManager.h include same wcxhead.h so preprocessor inserts same definitions into same source file more than once), it reports a bunch of errors.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35767
Location: Switzerland

PostPosted: Wed May 16, 2012 9:40 am    Post subject: Reply with quote

I see - just don't include header files within header files.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8040
Location: Russian Federation

PostPosted: Wed May 16, 2012 10:48 am    Post subject: Reply with quote

It is much easier to say than to do. Smile
Good style tells not to define stuff that doesn't required in this source file, so there may be different header files that include some common header files (like Windows.h or WchHead.h). So it is better to have such protection in common header files.

In case of Multiarc it wasn't my fault/code so I simply added this protection to get rid of the problem.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
speller2
Junior Member
Junior Member


Joined: 26 Jan 2009
Posts: 72
Location: Russia

PostPosted: Mon May 28, 2012 9:32 am    Post subject: Reply with quote

Is there a way to handle the new file creation by Shift+F4 inside a FS plugin?
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35767
Location: Switzerland

PostPosted: Mon May 28, 2012 9:41 am    Post subject: Reply with quote

No, sorry.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
speller2
Junior Member
Junior Member


Joined: 26 Jan 2009
Posts: 72
Location: Russia

PostPosted: Mon May 28, 2012 4:42 pm    Post subject: Reply with quote

What is a problem to add it?
Back to top
View user's profile Send private message
speller2
Junior Member
Junior Member


Joined: 26 Jan 2009
Posts: 72
Location: Russia

PostPosted: Tue May 29, 2012 1:05 am    Post subject: Reply with quote

Think it should be implemented, to avoid using pseudo-files (such as "[New file]" or "::: New file :::" in common file list.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35767
Location: Switzerland

PostPosted: Tue May 29, 2012 4:00 am    Post subject: Reply with quote

It should be doable, but I can't say yet how difficult it would be.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
speller2
Junior Member
Junior Member


Joined: 26 Jan 2009
Posts: 72
Location: Russia

PostPosted: Tue May 29, 2012 4:31 am    Post subject: Reply with quote

Hope it will be implemented soon Smile

Another suggestion: add ability to FS plugins to provide custom menu items in the right-clik menu (or to replace entire menu with own items, or to provide own items and move standard items to submenu).
Back to top
View user's profile Send private message
KuttKatrea
Junior Member
Junior Member


Joined: 16 Feb 2010
Posts: 19
Location: Mexico

PostPosted: Tue Apr 01, 2014 5:19 pm    Post subject: Reply with quote

Is it possible to get a way to directly move, copy and delete folders in FS-Plugins instead of processing contents first?

I'm developing a FS-plugin for Cloud Storage Providers, but they normally use an id for each file or folders.

Associated to these id are permissions (sharing) and history, so if a folder is moved (folder-to-folder) the permissions remains untouched. But with the recreate-tree that TC uses, the folder structure is recreated and the sharing permissions for the folders are lost.
_________________
~ Build up ~
Back to top
View user's profile Send private message Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8040
Location: Russian Federation

PostPosted: Tue Apr 01, 2014 11:52 pm    Post subject: Reply with quote

I support such WFX interface extension, it would be useful if plugin could perform operations with entire folders w/o recursion. Of course TC should do regular recursive operation if plugin doesn't support such feature or returns some error on such operation request in order to tell TC to perform usual operation.

I asked to add a possibility to put directories to WFX w/o recursion some years ago but with no luck.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Wed Apr 02, 2014 3:18 am    Post subject: Reply with quote

KuttKatrea wrote:
Is it possible to get a way to directly move, copy and delete folders in FS-Plugins instead of processing contents first?

Perhaps you can present these folders as virtual files and solve it that way?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group