Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-04-2010, 08:12 PM   #1
adfrad
Junior Member
adfrad began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2009
Location: UK
Device: PRS505
Calibre 0.7.x can't open UNC path

Hi,
I have just upgraded from .6 to .7, and am experiencing some strange issues.
I store my DB and files on a share accessed by UNC. e.g. \\server\ebooks\Iain Banks\Complicity
The books are accessible to Calibre and it can copy them accross to my ebook reader, however hitting "o" or clicking the hyperlink to open the folder fails. I don;t get any error messages, and the program doesn;t hang.. it just doesn't do anything.
I'[ve been running like this for a couple of years without any issues, and it's only since I upgraded that it's occurred. I'm on 0.7.7 and the issue still remains. Does anyone know what the issue is and do you have a workaround.
Thanks,
Adam
adfrad is offline   Reply With Quote
Old 07-04-2010, 08:27 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by adfrad View Post
however hitting "o" or clicking the hyperlink to open the folder fails. I don;t get any error messages, and the program doesn;t hang..
Ever since 0.7.x in order for this to work the drive has to be mapped.
DoctorOhh is offline   Reply With Quote
Advert
Old 07-05-2010, 04:31 AM   #3
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by dwanthny View Post
Ever since 0.7.x in order for this to work the drive has to be mapped.
True, its a bug in QT, NOT Calibre although the code might have changed between 0.6, where it works and 0.7 where it doesn't.
If you can't map a drive, for what ever reason, I might be willing to upload a recompiled QT-4.6.2 dll for you.
I found a bug report in QT's bugtracker but doubt if they are going to fix it. Didn't see any developers comments except 'future version' status

Maybe the simplest solution would be to directly call ShellExecute from Calibre instead of going through QDesktopServices.openUrl() which contains this bug.

I'll check later today and if viable I'll post a simple patch until this is resolved by QT or incorporated into Caliber.

Regards,

Joop
JvdW is offline   Reply With Quote
Old 07-06-2010, 05:54 PM   #4
adfrad
Junior Member
adfrad began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2009
Location: UK
Device: PRS505
Thank you for your fast answers.
I have mapped a drive, and it is now behaving normally
adfrad is offline   Reply With Quote
Old 07-07-2010, 08:31 AM   #5
JvdW
Zealot
JvdW doesn't litterJvdW doesn't litter
 
Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
Quote:
Originally Posted by JvdW View Post
I'll check later today and if viable I'll post a simple patch until this is resolved by QT or incorporated into Caliber.
To follow up I did the following:
- install Calibre-0.7.7
- downloaded the source of calibre-0.7.7
- unpack
- rename %INSTALL_DIR%\calibre\Lib\site-packages\calibre\gui2\__init__.pyo to __init__.pyo.orig
- find \calibre-0.77\src\calibre\gui2\__init__.py
- copy that to %INSTALL_DIR%\Lib\site-packages\calibre\gui2\__init__.py
- load __init__.py into an editor
- goto line 582 (def open_url(qurl))
- select from 582 to 596
- delete
- replace with the following
Code:
def open_url(qurl, path):
    paths = os.environ.get('LD_LIBRARY_PATH',
                '').split(os.pathsep)
    paths = [x for x in paths if x]
    if isfrozen and islinux and paths:
        npaths = [x for x in paths if x != sys.frozen_path]
        os.environ['LD_LIBRARY_PATH'] = os.pathsep.join(npaths)
    if iswindows:
        os.startfile(path)
    else:
        QDesktopServices.openUrl(qurl)
    if isfrozen and islinux and paths:
        os.environ['LD_LIBRARY_PATH'] = os.pathsep.join(paths)


def open_local_file(path):
    url = QUrl.fromLocalFile(path)
    open_url(url, path)
- save
- start calibre and hopefully no errors and a working UNC solution.
(error might be that indents don't match, python is sensitive to extra spaces, or tabs instead of spaces. Watch out for editors which auto convert spaces<->tabs!!)
- rinse and repeat if new version come out and Kovid doesn't like my hacking or there is no other solution.

Problem I workaround is QDesktopServices.openUrl(qurl) function which converts qurl back to a localfile but messes up big time on that.
Example
a = '\\server\path\a.pdf'
b = fromLocalFile(a)
c = toLocalFile(b)
c is not equal to a, it should!

It works for me, might not for you, be careful with your data, BACKUP if you don't know what you're doing, Told you, you have been warned!
Regards,

Joop
JvdW is offline   Reply With Quote
Advert
Reply

Tags
bug


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Path Calibre Themus Calibre 2 08-12-2010 10:44 PM
Library using UNC path, PDF's not opening JvdW Calibre 3 06-16-2010 10:54 AM
[Bug] Calibre using all lower case path names krunk Calibre 0 05-01-2010 02:58 PM
Specify liberary path in command line when launching calibre rollercoaster Calibre 2 03-04-2010 12:08 AM
Calibre in Windows path banjomike Calibre 13 09-04-2009 12:58 PM


All times are GMT -4. The time now is 01:42 PM.


MobileRead.com is a privately owned, operated and funded community.