Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2015, 01:29 PM   #61
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,373
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Turtle91 View Post
:I went in and removed the sgc-toc.css file that I had stored in the preferences folder this morning....and then it DID confirm!!
The sgc-toc.css being present in the Preferences folder definitely changes what "Create HTML Table of Contents" does; so it doesn't surprise me that it being there has an impact this series of steps.
DiapDealer is offline   Reply With Quote
Old 03-25-2015, 01:29 PM   #62
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Turtle91 View Post


I'm not able to get it to recreate with those steps...

HOWEVER!!

I went in and removed the sgc-toc.css file that I had stored in the preferences folder this morning....and then it DID confirm!!

So, somewhere between creating a new sgc-toc.css file vs. using a templated one??
Hmm perhaps there are two bugs here or one related bug.

The following patch fixed the bug for me but I do not have a recent 0.8.4 tree sitting around to test with. My version of Sigil is based on my git master and it is much different from Sigil 0.8.4.

So DiapDealer (or anyone else who builds their own), if you get a free moment and have a 0.8.4 tree around someplace, please try the following patch and see if it fixes the bug for you.

Code:
--- src/Sigil/MainUI/BookBrowser.cpp~	2015-02-28 16:48:28.000000000 -0500
+++ src/Sigil/MainUI/BookBrowser.cpp	2015-03-25 13:16:19.000000000 -0400
@@ -638,7 +638,11 @@
             }
         } else {
             // TODO: adding a CSS file should add the referenced fonts too
-            m_Book->GetFolderKeeper().AddContentFileToFolder(filepath);
+            Resource & resource = m_Book->GetFolderKeeper().AddContentFileToFolder(filepath);
+            if (resource.Type() == Resource::CSSResourceType) {
+                CSSResource *css_resource = qobject_cast<CSSResource *> (&resource);
+                css_resource->InitialLoad();
+            }
         }
 
         added_files.append(filepath);
The patch forces the CSSResource to actually load the file into its own QTextDocument.

This would have been done for you if you used the Tab to open the new .css file and changed it. It is always done for every css file for that is imported by loading an epub. But the AddExisting path did not do this, which is what caused the bug. I still haven't figured out how the Create HTML TOC impacts this but I think this should do the trick since it makes the newly added css file act just like one loaded from an original epub.

Last edited by KevinH; 03-25-2015 at 01:36 PM.
KevinH is offline   Reply With Quote
Advert
Old 03-25-2015, 01:51 PM   #63
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,318
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Nice work Kevin!
Turtle91 is offline   Reply With Quote
Old 03-25-2015, 02:07 PM   #64
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,373
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
So DiapDealer (or anyone else who builds their own), if you get a free moment and have a 0.8.4 tree around someplace, please try the following patch and see if it fixes the bug for you.
It certainly fixed it on my end!
DiapDealer is offline   Reply With Quote
Old 03-25-2015, 02:23 PM   #65
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
It certainly fixed it on my end!
Hi DiapDealer,

Wonderful news! I was worried it was a bug I introduced into my spring cleaning in Sigil master. Glad to hear the bug existed in Sigil 0.8.4 and can be fixed by that patch.

We should probably wait awhile and release a Sigil 0.8.5 with any other bug fixes we have before starting the alpha Sigil 0.9.0 series.

Thanks!

KevinH
KevinH is offline   Reply With Quote
Advert
Old 03-25-2015, 02:31 PM   #66
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
I still haven't figured out how the Create HTML TOC impacts this but I think this should do the trick since it makes the newly added css file act just like one loaded from an original epub.
FWIW, there is a small gap/race in the TextResource.cpp code between when SetText() is called the first time if it has to cache the text to be loaded because it is not in the GUI thread. It will automatically load the cache into the QTextDocument after a single-shot timer expires when we are back in the GUI thread.

But if a call to SaveToDisk (such as doing a File->SaveAs) is made during that interval it will incorrectly read from the QTextDocument (which is empty because it was waiting to be loaded!) and writing it to disk resulting in the disappearing file.

Technically it could happen to any text based resource (OPF, XHTML, CSS, etc) but initial loading was always done so all you were losing might have been the difference between it and its cache if anything at all.

So I have made an additional change to try to close that tiny hole in Sigil master so we are not bitten by this. It was the same bug that made font url's not be properly updated in CSS files too.

Thanks to all for reporting the bug so we could get this tracked down.

Kevin

Last edited by KevinH; 03-25-2015 at 03:35 PM.
KevinH is offline   Reply With Quote
Old 03-25-2015, 04:22 PM   #67
pete6055
Connoisseur
pete6055 began at the beginning.
 
Posts: 72
Karma: 10
Join Date: Nov 2012
Device: none
Quote:
Originally Posted by KevinH View Post
FWIW, there is a small gap/race in the TextResource.cpp code between when SetText() is called the first time if it has to cache the text to be loaded because it is not in the GUI thread. It will automatically load the cache into the QTextDocument after a single-shot timer expires when we are back in the GUI thread.

But if a call to SaveToDisk (such as doing a File->SaveAs) is made during that interval it will incorrectly read from the QTextDocument (which is empty because it was waiting to be loaded!) and writing it to disk resulting in the disappearing file.

Technically it could happen to any text based resource (OPF, XHTML, CSS, etc) but initial loading was always done so all you were losing might have been the difference between it and its cache if anything at all.

So I have made an additional change to try to close that tiny hole in Sigil master so we are not bitten by this. It was the same bug that made font url's not be properly updated in CSS files too.

Thanks to all for reporting the bug so we could get this tracked down.

Kevin
Kevin,

This sounds like it explains everything I've reported, with the possible exception of the "file jumping" symptom, and that could simply be a resource issue associated with the conflicts you closed.

I can't wait to test 8.5, whenever it's released. Congrats!!!
pete6055 is offline   Reply With Quote
Old 03-26-2015, 02:50 AM   #68
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Sounds like very good bughunting and code knowledge. Very good job and it proves how important it is to be able to reproduce an error...
Toxaris is offline   Reply With Quote
Old 03-27-2015, 08:55 AM   #69
montanayank
Junior Member
montanayank began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2015
Device: Kindle
I'll try the workaround

Well, I'm glad to see other users have experienced this and that it's not unique to me or that I did something stupid like inadvertently gotten "confused between the source material you started with and the epub Sigil turns them into."

I have used Sigil for several years now (on over 50 books!) and never had this problem until the last couple of iterations, I haven't done anything different than I did in the past when the problem didn't exist.

It's quite frustrating. But I will try the workaround of adding a space to the css next time. Seems like a weird solution, but I'll try anything.

As a recap-- here is what happens:

* I enter the html into the Sigil doc and link it to my css called georgia.css. Everything looks dandy
* I insert an image file and the georgia.css formatting disappears even tho the georgia.css file is still in the Style file, and the linked stylesheet for each chapter is listed as georgia.css. So, I reinstall the georgia.css file and reset all the individual chapters.

OR, sometimes, it's not even the insertion of an image file that causes this. Sometimes it just seems to happen randomly as I add another chapter.

I am using the latest iteration of Sigil, and as I've said, this only started happening maybe 4 iterations ago. Previously it never happened and I was using the same CSS file, same processes.
montanayank is offline   Reply With Quote
Old 03-27-2015, 10:33 AM   #70
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
Hi,

Yes, simply opening the css file in a tab of its own (and adding a space or making a minor edit) will force an InitialLoad of the resource, which is what the patch changes. So that should do the trick to prevent the bug until a new release is made. At least for the disappearing css.

The Create HTML TOC crash is something else and as far as I know there is no easy workaround.
KevinH is offline   Reply With Quote
Old 07-26-2015, 03:34 PM   #71
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,318
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Hi,
I just wanted to let you know that this bug has crept in again...the CSS page disappearing...

I'm thinking the patch wasn't included in one of the latest updates or something. It has an easy workaround, I just add the space to the CSS file on initial creation. I figure this has already been included in the next release, but wanted to make sure you were aware it is still there.

Cheers!
Turtle91 is offline   Reply With Quote
Old 07-26-2015, 04:17 PM   #72
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
Is this with Sigil 0.8.5, Sigil 0.8.6 or Sigil 0.8.7?

If Sigil 0.8.7 then it could be caused by a late change in the Sigil 0.8.7 tree used for user_none's farewell release that broke many signals.

If Sigil 0.8.5, my own bug fix broke a few things and this more correctly fixed in Sigil 0.8.6.

KevinH
KevinH is offline   Reply With Quote
Old 07-26-2015, 06:40 PM   #73
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,318
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
It is 8.7. I try and keep up with the latest and greatest!
Turtle91 is offline   Reply With Quote
Old 07-26-2015, 06:53 PM   #74
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,493
Karma: 5703586
Join Date: Nov 2009
Device: many
The only change in Sigil 0.8.7 was changing the About info, and an attempt to work around illegal use of null references which ended up breaking many things. Fixing it would require backporting a huge set of reference to pointer changes all throughout Sigil master to the Sigil 0.8.x source tree.

So, I strongly recommend you stick with the Sigil 0.8.6 release. It was built with an older compiler that allowed null references to be passed around and therefore has no issues. I really should recall the Sigil 0.8.7 release given many things are broken in it.

Take care,

KevinH
KevinH is offline   Reply With Quote
Old 07-27-2015, 08:29 PM   #75
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,318
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I just had the same thing happen in 8.6....although it could be the way I "downgraded", "ungraded", "went back"... I just installed 8.6 without uninstalling 8.7 (I didn't want to lose any settings, PIs, etc.) It seemed to overwrite the files and when I checked the version it said 8.6.... soooo..... I really don't want to be thought of as a computer ignoramous...so please tell me it's not my fault
Turtle91 is offline   Reply With Quote
Reply

Tags
css changes


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADE breaks CSS --> CSS Validation: Parse Error / Value Error dasboeh ePub 4 12-10-2012 03:25 AM
Override ePub CSS with userStyle.css? barium Sony Reader Dev Corner 11 07-16-2011 03:25 PM
CSS Help Please Japes Calibre 21 06-23-2011 05:05 PM
epub CSS versus "Regular" CSS konrad ePub 4 02-18-2011 09:29 AM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM


All times are GMT -4. The time now is 09:14 PM.


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