Removed debug printing from TimelineWindowUpdater.

Thread should survive now after system sleep
This commit is contained in:
Snowyfox 2022-04-27 06:12:10 -04:00
parent 10406a2c10
commit 26d4e8c97a
20 changed files with 21 additions and 25 deletions

0
ComposeWindow.java Normal file → Executable file
View File

0
ImageApi.java Normal file → Executable file
View File

0
JKomasto.java Normal file → Executable file
View File

0
LoginWindow.java Normal file → Executable file
View File

0
PostWindow.java Normal file → Executable file
View File

View File

@ -26,6 +26,26 @@ RudimentaryHTMLParser {
}
}
public static String
stripTags(String html)
{
StringBuilder returnee = new StringBuilder();
for (Tree<String> node: depthlessRead(html))
{
if (node.key.equals("tag")) continue;
if (node.key.equals("emoji"))
{
returnee.append(":" + node.value + ":");
}
if (node.key.equals("text"))
{
returnee.append(node.value);
}
}
return returnee.toString();
}
// - -%- -
private static Tree<String>

18
TimelineWindow.java Normal file → Executable file
View File

@ -624,23 +624,7 @@ implements
c.setBottom("(" + cw + ")");
}
else {
StringBuilder bu = new StringBuilder();
Tree<String> nodes;
nodes = RudimentaryHTMLParser.depthlessRead(html);
for (Tree<String> node: nodes)
{
if (node.key.equals("tag"))
{
String tagName = node.get(0).key;
if (tagName.equals("br")) bu.append(" \n ");
if (tagName.equals("/p")) bu.append(" \n \n ");
}
if (node.key.equals("text"))
bu.append(node.value);
if (node.key.equals("emoji"))
bu.append(":" + node.value + ":");
}
c.setBottom(bu.toString() + " ");
c.setBottom(RudimentaryHTMLParser.stripTags(html) + " ");
}
}
for (int o = posts.size(); o < postPreviews.size(); ++o)

8
TimelineWindowUpdater.java Normal file → Executable file
View File

@ -51,8 +51,6 @@ TimelineWindowUpdater {
default: return;
}
t.start();
System.err.println(t);
}
public void
@ -66,8 +64,6 @@ TimelineWindowUpdater {
private void
handle(TimelineType type, String event, String data)
{
System.err.println("Handling " + event + ".");
assert !data.isEmpty();
if (event.isEmpty()) return;
@ -76,7 +72,6 @@ TimelineWindowUpdater {
if (!(newPost || newNotif)) return;
for (TimelineWindow updatee: filter(type)) {
System.err.println("Refreshing " + updatee);
updatee.showLatestPage();
}
}
@ -115,14 +110,11 @@ TimelineWindowUpdater {
api.monitorTimeline(type, this);
// monitorTimeline should not return
// until the connection is closed.
System.err.println("Finit.");
}
public void
lineReceived(String line)
{
System.err.println("Line: " + line);
if (line.startsWith(":")) return;
if (line.isEmpty()) {

0
TwoToggleButton.java Normal file → Executable file
View File

0
graphics/Flags.xcf Normal file → Executable file
View File

0
graphics/Hourglass.xcf Normal file → Executable file
View File

0
graphics/button.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
graphics/disabledOverlay.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
graphics/favouriteToggled.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 353 B

0
graphics/ref1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
graphics/selectedOverlay.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

0
graphics/test1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
graphics/test2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
graphics/test3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
graphics/test4.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB